{"id":2128,"date":"2025-10-29T11:00:08","date_gmt":"2025-10-29T05:30:08","guid":{"rendered":"https:\/\/www.smsgatewaycenter.com\/blog\/?post_type=docs&#038;p=2128"},"modified":"2025-10-29T11:00:10","modified_gmt":"2025-10-29T05:30:10","password":"","slug":"tls13-upgrade-guide","status":"publish","type":"docs","link":"https:\/\/www.smsgatewaycenter.com\/blog\/kb\/tls13-upgrade-guide\/","title":{"rendered":"How to Upgrade to TLS 1.3 for SMS Gateway Center API Integration"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">This guide provides step-by-step instructions for upgrading your system to support <strong>TLS 1.3<\/strong> (Transport Layer Security version 1.3) for secure API communications with <strong><a href=\"https:\/\/www.smsgatewaycenter.com\">SMS Gateway Center<\/a><\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Official API Endpoint:<\/strong> <code>https:\/\/unify.smsgateway.center\/SMSApi\/send<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>TLS 1.3 Benefits:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u2705 Faster handshake (reduced latency)<\/li>\n\n\n\n<li>\u2705 Enhanced security with modern encryption<\/li>\n\n\n\n<li>\u2705 Improved privacy protection<\/li>\n\n\n\n<li>\u2705 Better performance for API calls<\/li>\n\n\n\n<li>\u2705 Future-proof your integration<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Minimum Acceptable Version:<\/strong> TLS 1.2<br><strong>Recommended Version:<\/strong> TLS 1.3<br><strong>Deadline for Upgrade:<\/strong> November 15, 2025<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">API Endpoint Information<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Base URL:<\/strong> <code>https:\/\/unify.smsgateway.center<\/code><br><strong>Send SMS Endpoint:<\/strong> <code>\/SMSApi\/send<\/code><br><strong>Method:<\/strong> <code>POST<\/code><br><strong>Content-Type:<\/strong> <code>application\/x-www-form-urlencoded<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Required Headers:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>apikey<\/code>: Your API key<\/li>\n\n\n\n<li><code>cache-control<\/code>: no-cache<\/li>\n\n\n\n<li><code>content-type<\/code>: application\/x-www-form-urlencoded<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Required Parameters:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>userid<\/code>: Your username<\/li>\n\n\n\n<li><code>password<\/code>: Your password<\/li>\n\n\n\n<li><code>sendMethod<\/code>: quick | group | file<\/li>\n\n\n\n<li><code>mobile<\/code>: Mobile number(s)<\/li>\n\n\n\n<li><code>msg<\/code>: Message text<\/li>\n\n\n\n<li><code>senderid<\/code>: Approved sender ID<\/li>\n\n\n\n<li><code>msgType<\/code>: text | unicode<\/li>\n\n\n\n<li><code>duplicatecheck<\/code>: true | false<\/li>\n\n\n\n<li><code>output<\/code>: json | xml<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Table of Contents<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><a href=\"#php-users\">PHP<\/a><\/li>\n\n\n\n<li><a href=\"#java-users\">Java<\/a><\/li>\n\n\n\n<li><a href=\"#net-c-users\">.NET \/ C#<\/a><\/li>\n\n\n\n<li><a href=\"#python-users\">Python<\/a><\/li>\n\n\n\n<li><a href=\"#nodejs-users\">Node.js<\/a><\/li>\n\n\n\n<li><a href=\"#ruby-users\">Ruby<\/a><\/li>\n\n\n\n<li><a href=\"#go-golang-users\">Go (Golang)<\/a><\/li>\n\n\n\n<li><a href=\"#curl-command-line\">cURL \/ Command Line<\/a><\/li>\n\n\n\n<li><a href=\"#testing-verification\">Testing &amp; Verification<\/a><\/li>\n\n\n\n<li><a href=\"#troubleshooting\">Troubleshooting<\/a><\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">PHP Users<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">System Requirements<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Minimum Versions:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>PHP 7.4+ (TLS 1.3 support)<\/li>\n\n\n\n<li>OpenSSL 1.1.1+ (for full TLS 1.3 support)<\/li>\n\n\n\n<li>cURL 7.52.0+ with OpenSSL 1.1.1+<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Check Current Version<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># Check PHP version\nphp -v\n\n# Check OpenSSL version\nphp -r \"echo OPENSSL_VERSION_TEXT . PHP_EOL;\"\n\n# Check cURL version\nphp -r \"echo curl_version()&#91;'version'] . PHP_EOL;\"<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Upgrade OpenSSL (Ubuntu\/Debian)<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># Update package list\nsudo apt update\n\n# Upgrade OpenSSL\nsudo apt install openssl libssl-dev\n\n# Verify OpenSSL version (should be 1.1.1 or higher)\nopenssl version\n\n# Restart web server\nsudo systemctl restart apache2\n# OR for Nginx:\nsudo systemctl restart nginx\n# OR for PHP-FPM:\nsudo systemctl restart php8.2-fpm<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">PHP Code Implementation<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Force TLS 1.3 with cURL:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n\/**\n * SMS Gateway Center API - TLS 1.3 Implementation\n *\/\n\nclass SMSGatewayAPI {\n    private $apiUrl = 'https:\/\/unify.smsgateway.center\/SMSApi\/send';\n    private $apiKey;\n    private $userId;\n    private $password;\n\n    public function __construct($apiKey, $userId, $password) {\n        $this-&gt;apiKey = $apiKey;\n        $this-&gt;userId = $userId;\n        $this-&gt;password = $password;\n    }\n\n    \/**\n     * Send SMS with TLS 1.3\n     *\/\n    public function sendSMS($mobile, $message, $senderId, $msgType = 'text', $output = 'json') {\n        $postData = &#91;\n            'userid' =&gt; $this-&gt;userId,\n            'password' =&gt; $this-&gt;password,\n            'sendMethod' =&gt; 'quick',\n            'mobile' =&gt; $mobile,\n            'msg' =&gt; $message,\n            'senderid' =&gt; $senderId,\n            'msgType' =&gt; $msgType,\n            'duplicatecheck' =&gt; 'true',\n            'output' =&gt; $output\n        ];\n\n        $ch = curl_init();\n\n        curl_setopt_array($ch, &#91;\n            CURLOPT_URL =&gt; $this-&gt;apiUrl,\n            CURLOPT_POST =&gt; true,\n            CURLOPT_POSTFIELDS =&gt; http_build_query($postData),\n            CURLOPT_RETURNTRANSFER =&gt; true,\n            CURLOPT_SSL_VERIFYPEER =&gt; true,\n            CURLOPT_SSL_VERIFYHOST =&gt; 2,\n\n            \/\/ Force TLS 1.3 (with TLS 1.2 fallback)\n            CURLOPT_SSLVERSION =&gt; CURL_SSLVERSION_TLSv1_3,\n\n            \/\/ Headers\n            CURLOPT_HTTPHEADER =&gt; &#91;\n                'apikey: ' . $this-&gt;apiKey,\n                'cache-control: no-cache',\n                'content-type: application\/x-www-form-urlencoded'\n            ],\n\n            CURLOPT_TIMEOUT =&gt; 30,\n            CURLOPT_CONNECTTIMEOUT =&gt; 10\n        ]);\n\n        $response = curl_exec($ch);\n        $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\n        if (curl_errno($ch)) {\n            $error = curl_error($ch);\n            curl_close($ch);\n            throw new Exception(\"cURL Error: $error\");\n        }\n\n        curl_close($ch);\n\n        return &#91;\n            'success' =&gt; ($httpCode == 200),\n            'http_code' =&gt; $httpCode,\n            'response' =&gt; json_decode($response, true)\n        ];\n    }\n}\n\n\/\/ Usage Example\ntry {\n    $sms = new SMSGatewayAPI('YOUR_API_KEY', 'YOUR_USERNAME', 'YOUR_PASSWORD');\n\n    $result = $sms-&gt;sendSMS(\n        '919876543210',\n        'Test message with TLS 1.3',\n        'SGCSMS',\n        'text',\n        'json'\n    );\n\n    if ($result&#91;'success']) {\n        echo \"\u2705 SMS sent successfully!\\n\";\n        print_r($result&#91;'response']);\n    } else {\n        echo \"\u274c Failed with HTTP code: \" . $result&#91;'http_code'] . \"\\n\";\n    }\n\n} catch (Exception $e) {\n    echo \"\u274c Error: \" . $e-&gt;getMessage() . \"\\n\";\n}\n?&gt;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Test TLS 1.3 in PHP<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n\/\/ Quick TLS 1.3 Test Script\n$ch = curl_init('https:\/\/unify.smsgateway.center');\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_3);\ncurl_setopt($ch, CURLOPT_VERBOSE, true);\n\n$verbose = fopen('php:\/\/temp', 'w+');\ncurl_setopt($ch, CURLOPT_STDERR, $verbose);\n\n$result = curl_exec($ch);\n\nif (curl_errno($ch)) {\n    echo \"\u274c TLS 1.3 NOT supported: \" . curl_error($ch) . \"\\n\";\n} else {\n    echo \"\u2705 TLS 1.3 IS supported!\\n\";\n\n    \/\/ Get SSL info\n    rewind($verbose);\n    $verboseLog = stream_get_contents($verbose);\n    if (preg_match('\/TLSv1.3\/', $verboseLog)) {\n        echo \"\u2705 Connected using TLS 1.3\\n\";\n    }\n}\n\ncurl_close($ch);\nfclose($verbose);\n?&gt;<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Java Users<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">System Requirements<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Minimum Versions:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Java 11+ (full TLS 1.3 support)<\/li>\n\n\n\n<li>Java 8u261+ (limited TLS 1.3 support)<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Java Code Implementation<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>import java.io.*;\nimport java.net.*;\nimport java.nio.charset.StandardCharsets;\nimport javax.net.ssl.*;\n\npublic class SMSGatewayTLS13 {\n\n    private static final String API_URL = \"https:\/\/unify.smsgateway.center\/SMSApi\/send\";\n    private String apiKey;\n    private String userId;\n    private String password;\n\n    public SMSGatewayTLS13(String apiKey, String userId, String password) {\n        this.apiKey = apiKey;\n        this.userId = userId;\n        this.password = password;\n    }\n\n    public static void main(String&#91;] args) {\n        try {\n            SMSGatewayTLS13 sms = new SMSGatewayTLS13(\n                \"YOUR_API_KEY\",\n                \"YOUR_USERNAME\",\n                \"YOUR_PASSWORD\"\n            );\n\n            String response = sms.sendSMS(\n                \"919876543210\",\n                \"Test message with TLS 1.3\",\n                \"SGCSMS\",\n                \"text\",\n                \"json\"\n            );\n\n            System.out.println(\"\u2705 Response: \" + response);\n\n        } catch (Exception e) {\n            e.printStackTrace();\n        }\n    }\n\n    public String sendSMS(String mobile, String message, String senderId, \n                         String msgType, String output) throws Exception {\n\n        \/\/ Enable TLS 1.3\n        System.setProperty(\"https.protocols\", \"TLSv1.3\");\n\n        \/\/ Prepare POST data\n        String postData = String.format(\n            \"userid=%s&amp;password=%s&amp;sendMethod=quick&amp;mobile=%s&amp;msg=%s&amp;senderid=%s&amp;msgType=%s&amp;duplicatecheck=true&amp;output=%s\",\n            URLEncoder.encode(userId, StandardCharsets.UTF_8),\n            URLEncoder.encode(password, StandardCharsets.UTF_8),\n            URLEncoder.encode(mobile, StandardCharsets.UTF_8),\n            URLEncoder.encode(message, StandardCharsets.UTF_8),\n            URLEncoder.encode(senderId, StandardCharsets.UTF_8),\n            URLEncoder.encode(msgType, StandardCharsets.UTF_8),\n            URLEncoder.encode(output, StandardCharsets.UTF_8)\n        );\n\n        byte&#91;] postDataBytes = postData.getBytes(StandardCharsets.UTF_8);\n\n        URL url = new URL(API_URL);\n        HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();\n\n        \/\/ Force TLS 1.3\n        SSLContext sslContext = SSLContext.getInstance(\"TLSv1.3\");\n        sslContext.init(null, null, null);\n        conn.setSSLSocketFactory(sslContext.getSocketFactory());\n\n        \/\/ Set request properties\n        conn.setRequestMethod(\"POST\");\n        conn.setRequestProperty(\"apikey\", apiKey);\n        conn.setRequestProperty(\"cache-control\", \"no-cache\");\n        conn.setRequestProperty(\"content-type\", \"application\/x-www-form-urlencoded\");\n        conn.setRequestProperty(\"Content-Length\", String.valueOf(postDataBytes.length));\n        conn.setDoOutput(true);\n        conn.setConnectTimeout(10000);\n        conn.setReadTimeout(30000);\n\n        \/\/ Send POST data\n        try (OutputStream os = conn.getOutputStream()) {\n            os.write(postDataBytes);\n        }\n\n        \/\/ Read response\n        int responseCode = conn.getResponseCode();\n        System.out.println(\"\u2705 Response Code: \" + responseCode);\n        System.out.println(\"\u2705 Cipher Suite: \" + conn.getCipherSuite());\n\n        StringBuilder response = new StringBuilder();\n        try (BufferedReader br = new BufferedReader(\n                new InputStreamReader(conn.getInputStream()))) {\n            String line;\n            while ((line = br.readLine()) != null) {\n                response.append(line);\n            }\n        }\n\n        conn.disconnect();\n        return response.toString();\n    }\n}<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">.NET \/ C# Users<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">C# Code Implementation<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>using System;\nusing System.Net;\nusing System.Net.Http;\nusing System.Security.Authentication;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace SMSGatewayTLS13\n{\n    class SMSGatewayAPI\n    {\n        private const string API_URL = \"https:\/\/unify.smsgateway.center\/SMSApi\/send\";\n        private string apiKey;\n        private string userId;\n        private string password;\n\n        public SMSGatewayAPI(string apiKey, string userId, string password)\n        {\n            this.apiKey = apiKey;\n            this.userId = userId;\n            this.password = password;\n        }\n\n        public async Task&lt;string&gt; SendSMS(string mobile, string message, string senderId, \n                                         string msgType = \"text\", string output = \"json\")\n        {\n            \/\/ Create HttpClientHandler with TLS 1.3\n            var handler = new HttpClientHandler\n            {\n                SslProtocols = SslProtocols.Tls13 | SslProtocols.Tls12\n            };\n\n            using (var httpClient = new HttpClient(handler))\n            {\n                httpClient.Timeout = TimeSpan.FromSeconds(30);\n\n                \/\/ Set headers\n                httpClient.DefaultRequestHeaders.Add(\"apikey\", apiKey);\n                httpClient.DefaultRequestHeaders.Add(\"cache-control\", \"no-cache\");\n\n                \/\/ Prepare form data\n                var postData = new FormUrlEncodedContent(new&#91;]\n                {\n                    new KeyValuePair&lt;string, string&gt;(\"userid\", userId),\n                    new KeyValuePair&lt;string, string&gt;(\"password\", password),\n                    new KeyValuePair&lt;string, string&gt;(\"sendMethod\", \"quick\"),\n                    new KeyValuePair&lt;string, string&gt;(\"mobile\", mobile),\n                    new KeyValuePair&lt;string, string&gt;(\"msg\", message),\n                    new KeyValuePair&lt;string, string&gt;(\"senderid\", senderId),\n                    new KeyValuePair&lt;string, string&gt;(\"msgType\", msgType),\n                    new KeyValuePair&lt;string, string&gt;(\"duplicatecheck\", \"true\"),\n                    new KeyValuePair&lt;string, string&gt;(\"output\", output)\n                });\n\n                try\n                {\n                    var response = await httpClient.PostAsync(API_URL, postData);\n                    response.EnsureSuccessStatusCode();\n\n                    var result = await response.Content.ReadAsStringAsync();\n\n                    Console.WriteLine($\"\u2705 Status Code: {response.StatusCode}\");\n                    Console.WriteLine($\"\u2705 Response: {result}\");\n\n                    return result;\n                }\n                catch (HttpRequestException ex)\n                {\n                    Console.WriteLine($\"\u274c Error: {ex.Message}\");\n                    throw;\n                }\n            }\n        }\n    }\n\n    class Program\n    {\n        static async Task Main(string&#91;] args)\n        {\n            var sms = new SMSGatewayAPI(\"YOUR_API_KEY\", \"YOUR_USERNAME\", \"YOUR_PASSWORD\");\n\n            try\n            {\n                await sms.SendSMS(\n                    \"919876543210\",\n                    \"Test message with TLS 1.3\",\n                    \"SGCSMS\",\n                    \"text\",\n                    \"json\"\n                );\n\n                Console.WriteLine(\"\u2705 SMS sent successfully!\");\n            }\n            catch (Exception ex)\n            {\n                Console.WriteLine($\"\u274c Failed: {ex.Message}\");\n            }\n        }\n    }\n}<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Python Users<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Python Code Implementation<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/usr\/bin\/env python3\n\"\"\"\nSMS Gateway Center API - TLS 1.3 Implementation\n\"\"\"\n\nimport requests\nfrom requests.adapters import HTTPAdapter\nfrom urllib3.util.ssl_ import create_urllib3_context\nimport ssl\n\nclass TLS13Adapter(HTTPAdapter):\n    \"\"\"Custom adapter to force TLS 1.3\"\"\"\n\n    def init_poolmanager(self, *args, **kwargs):\n        context = create_urllib3_context()\n        context.minimum_version = ssl.TLSVersion.TLSv1_3\n        context.maximum_version = ssl.TLSVersion.TLSv1_3\n        kwargs&#91;'ssl_context'] = context\n        return super().init_poolmanager(*args, **kwargs)\n\nclass SMSGatewayAPI:\n    \"\"\"SMS Gateway Center API with TLS 1.3\"\"\"\n\n    API_URL = 'https:\/\/unify.smsgateway.center\/SMSApi\/send'\n\n    def __init__(self, api_key, user_id, password):\n        self.api_key = api_key\n        self.user_id = user_id\n        self.password = password\n\n    def send_sms(self, mobile, message, sender_id, msg_type='text', output='json'):\n        \"\"\"\n        Send SMS using TLS 1.3\n\n        Args:\n            mobile (str): Mobile number with country code\n            message (str): SMS message text\n            sender_id (str): Approved sender ID\n            msg_type (str): 'text' or 'unicode'\n            output (str): 'json' or 'xml'\n\n        Returns:\n            dict: API response\n        \"\"\"\n\n        # Create session with TLS 1.3 adapter\n        session = requests.Session()\n        session.mount('https:\/\/', TLS13Adapter())\n\n        # Set headers\n        headers = {\n            'apikey': self.api_key,\n            'cache-control': 'no-cache',\n            'content-type': 'application\/x-www-form-urlencoded'\n        }\n\n        # Prepare POST data\n        post_data = {\n            'userid': self.user_id,\n            'password': self.password,\n            'sendMethod': 'quick',\n            'mobile': mobile,\n            'msg': message,\n            'senderid': sender_id,\n            'msgType': msg_type,\n            'duplicatecheck': 'true',\n            'output': output\n        }\n\n        try:\n            response = session.post(\n                self.API_URL,\n                headers=headers,\n                data=post_data,\n                timeout=30,\n                verify=True\n            )\n\n            response.raise_for_status()\n\n            print(f\"\u2705 Status Code: {response.status_code}\")\n            print(f\"\u2705 Response: {response.text}\")\n\n            return {\n                'success': True,\n                'status_code': response.status_code,\n                'response': response.json() if output == 'json' else response.text\n            }\n\n        except requests.exceptions.RequestException as e:\n            print(f\"\u274c Error: {e}\")\n            return {'success': False, 'error': str(e)}\n\n        finally:\n            session.close()\n\n# Usage Example\nif __name__ == '__main__':\n    sms = SMSGatewayAPI('YOUR_API_KEY', 'YOUR_USERNAME', 'YOUR_PASSWORD')\n\n    result = sms.send_sms(\n        mobile='919876543210',\n        message='Test message with TLS 1.3',\n        sender_id='SGCSMS',\n        msg_type='text',\n        output='json'\n    )\n\n    if result&#91;'success']:\n        print(\"\u2705 SMS sent successfully!\")\n    else:\n        print(f\"\u274c Failed: {result.get('error')}\")<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Node.js Users<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Node.js Code Implementation<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * SMS Gateway Center API - TLS 1.3 Implementation (Node.js)\n *\/\n\nconst https = require('https');\nconst querystring = require('querystring');\n\nclass SMSGatewayAPI {\n    constructor(apiKey, userId, password) {\n        this.apiKey = apiKey;\n        this.userId = userId;\n        this.password = password;\n        this.apiUrl = 'https:\/\/unify.smsgateway.center\/SMSApi\/send';\n    }\n\n    sendSMS(mobile, message, senderId, msgType = 'text', output = 'json') {\n        return new Promise((resolve, reject) =&gt; {\n            const postData = querystring.stringify({\n                userid: this.userId,\n                password: this.password,\n                sendMethod: 'quick',\n                mobile: mobile,\n                msg: message,\n                senderid: senderId,\n                msgType: msgType,\n                duplicatecheck: 'true',\n                output: output\n            });\n\n            const options = {\n                hostname: 'unify.smsgateway.center',\n                port: 443,\n                path: '\/SMSApi\/send',\n                method: 'POST',\n                headers: {\n                    'apikey': this.apiKey,\n                    'cache-control': 'no-cache',\n                    'content-type': 'application\/x-www-form-urlencoded',\n                    'Content-Length': Buffer.byteLength(postData)\n                },\n                minVersion: 'TLSv1.3',\n                maxVersion: 'TLSv1.3',\n                rejectUnauthorized: true\n            };\n\n            const req = https.request(options, (res) =&gt; {\n                console.log(`\u2705 Status Code: ${res.statusCode}`);\n                console.log(`\u2705 TLS Version: ${res.socket.getProtocol()}`);\n\n                let data = '';\n\n                res.on('data', (chunk) =&gt; {\n                    data += chunk;\n                });\n\n                res.on('end', () =&gt; {\n                    console.log(`\u2705 Response: ${data}`);\n                    resolve({\n                        success: true,\n                        statusCode: res.statusCode,\n                        response: output === 'json' ? JSON.parse(data) : data\n                    });\n                });\n            });\n\n            req.on('error', (error) =&gt; {\n                console.error(`\u274c Error: ${error.message}`);\n                reject(error);\n            });\n\n            req.setTimeout(30000);\n            req.write(postData);\n            req.end();\n        });\n    }\n}\n\n\/\/ Usage Example\n(async () =&gt; {\n    const sms = new SMSGatewayAPI('YOUR_API_KEY', 'YOUR_USERNAME', 'YOUR_PASSWORD');\n\n    try {\n        const result = await sms.sendSMS(\n            '919876543210',\n            'Test message with TLS 1.3',\n            'SGCSMS',\n            'text',\n            'json'\n        );\n\n        console.log('\u2705 SMS sent successfully!');\n    } catch (error) {\n        console.error('\u274c Failed:', error.message);\n    }\n})();<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Ruby Users<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Ruby Code Implementation<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/usr\/bin\/env ruby\n\nrequire 'net\/http'\nrequire 'uri'\nrequire 'openssl'\nrequire 'json'\n\nclass SMSGatewayAPI\n  API_URL = 'https:\/\/unify.smsgateway.center\/SMSApi\/send'.freeze\n\n  def initialize(api_key, user_id, password)\n    @api_key = api_key\n    @user_id = user_id\n    @password = password\n  end\n\n  def send_sms(mobile, message, sender_id, msg_type = 'text', output = 'json')\n    uri = URI(API_URL)\n\n    # Prepare POST data\n    params = {\n      'userid' =&gt; @user_id,\n      'password' =&gt; @password,\n      'sendMethod' =&gt; 'quick',\n      'mobile' =&gt; mobile,\n      'msg' =&gt; message,\n      'senderid' =&gt; sender_id,\n      'msgType' =&gt; msg_type,\n      'duplicatecheck' =&gt; 'true',\n      'output' =&gt; output\n    }\n\n    # Create HTTP client with TLS 1.3\n    http = Net::HTTP.new(uri.host, uri.port)\n    http.use_ssl = true\n    http.open_timeout = 10\n    http.read_timeout = 30\n\n    # Force TLS 1.3\n    http.min_version = OpenSSL::SSL::TLS1_3_VERSION\n    http.max_version = OpenSSL::SSL::TLS1_3_VERSION\n    http.verify_mode = OpenSSL::SSL::VERIFY_PEER\n\n    # Create POST request\n    request = Net::HTTP::Post.new(uri.request_uri)\n    request.set_form_data(params)\n    request&#91;'apikey'] = @api_key\n    request&#91;'cache-control'] = 'no-cache'\n    request&#91;'content-type'] = 'application\/x-www-form-urlencoded'\n\n    # Send request\n    begin\n      response = http.request(request)\n\n      puts \"\u2705 Status Code: #{response.code}\"\n      puts \"\u2705 Response: #{response.body}\"\n\n      {\n        success: true,\n        status_code: response.code,\n        response: output == 'json' ? JSON.parse(response.body) : response.body\n      }\n\n    rescue StandardError =&gt; e\n      puts \"\u274c Error: #{e.message}\"\n      { success: false, error: e.message }\n    end\n  end\nend\n\n# Usage Example\nif __FILE__ == $0\n  sms = SMSGatewayAPI.new('YOUR_API_KEY', 'YOUR_USERNAME', 'YOUR_PASSWORD')\n\n  result = sms.send_sms(\n    '919876543210',\n    'Test message with TLS 1.3',\n    'SGCSMS',\n    'text',\n    'json'\n  )\n\n  if result&#91;:success]\n    puts '\u2705 SMS sent successfully!'\n  else\n    puts \"\u274c Failed: #{result&#91;:error]}\"\n  end\nend<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Go (Golang) Users<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Go Code Implementation<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>package main\n\nimport (\n    \"crypto\/tls\"\n    \"fmt\"\n    \"io\"\n    \"net\/http\"\n    \"net\/url\"\n    \"strings\"\n    \"time\"\n)\n\ntype SMSGatewayAPI struct {\n    APIKey   string\n    UserID   string\n    Password string\n    Client   *http.Client\n}\n\nfunc NewSMSGatewayAPI(apiKey, userID, password string) *SMSGatewayAPI {\n    \/\/ Configure TLS 1.3\n    tlsConfig := &amp;tls.Config{\n        MinVersion: tls.VersionTLS13,\n        MaxVersion: tls.VersionTLS13,\n    }\n\n    transport := &amp;http.Transport{\n        TLSClientConfig:    tlsConfig,\n        MaxIdleConns:       10,\n        IdleConnTimeout:    30 * time.Second,\n    }\n\n    client := &amp;http.Client{\n        Transport: transport,\n        Timeout:   30 * time.Second,\n    }\n\n    return &amp;SMSGatewayAPI{\n        APIKey:   apiKey,\n        UserID:   userID,\n        Password: password,\n        Client:   client,\n    }\n}\n\nfunc (api *SMSGatewayAPI) SendSMS(mobile, message, senderID, msgType, output string) (string, error) {\n    apiURL := \"https:\/\/unify.smsgateway.center\/SMSApi\/send\"\n\n    \/\/ Prepare form data\n    formData := url.Values{\n        \"userid\":         {api.UserID},\n        \"password\":       {api.Password},\n        \"sendMethod\":     {\"quick\"},\n        \"mobile\":         {mobile},\n        \"msg\":            {message},\n        \"senderid\":       {senderID},\n        \"msgType\":        {msgType},\n        \"duplicatecheck\": {\"true\"},\n        \"output\":         {output},\n    }\n\n    \/\/ Create POST request\n    req, err := http.NewRequest(\"POST\", apiURL, strings.NewReader(formData.Encode()))\n    if err != nil {\n        return \"\", fmt.Errorf(\"failed to create request: %w\", err)\n    }\n\n    \/\/ Set headers\n    req.Header.Set(\"apikey\", api.APIKey)\n    req.Header.Set(\"cache-control\", \"no-cache\")\n    req.Header.Set(\"content-type\", \"application\/x-www-form-urlencoded\")\n\n    \/\/ Send request\n    resp, err := api.Client.Do(req)\n    if err != nil {\n        return \"\", fmt.Errorf(\"failed to send request: %w\", err)\n    }\n    defer resp.Body.Close()\n\n    \/\/ Check TLS version\n    if resp.TLS != nil {\n        fmt.Printf(\"\u2705 TLS Version: %s\\n\", getTLSVersionString(resp.TLS.Version))\n        fmt.Printf(\"\u2705 Cipher Suite: %s\\n\", tls.CipherSuiteName(resp.TLS.CipherSuite))\n    }\n\n    \/\/ Read response\n    body, err := io.ReadAll(resp.Body)\n    if err != nil {\n        return \"\", fmt.Errorf(\"failed to read response: %w\", err)\n    }\n\n    fmt.Printf(\"\u2705 Status Code: %d\\n\", resp.StatusCode)\n    fmt.Printf(\"\u2705 Response: %s\\n\", string(body))\n\n    return string(body), nil\n}\n\nfunc getTLSVersionString(version uint16) string {\n    switch version {\n    case tls.VersionTLS12:\n        return \"TLS 1.2\"\n    case tls.VersionTLS13:\n        return \"TLS 1.3\"\n    default:\n        return fmt.Sprintf(\"Unknown (0x%04x)\", version)\n    }\n}\n\nfunc main() {\n    api := NewSMSGatewayAPI(\"YOUR_API_KEY\", \"YOUR_USERNAME\", \"YOUR_PASSWORD\")\n\n    response, err := api.SendSMS(\n        \"919876543210\",\n        \"Test message with TLS 1.3\",\n        \"SGCSMS\",\n        \"text\",\n        \"json\",\n    )\n\n    if err != nil {\n        fmt.Printf(\"\u274c Error: %v\\n\", err)\n        return\n    }\n\n    fmt.Println(\"\u2705 SMS sent successfully!\")\n}<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">cURL \/ Command Line<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Test TLS 1.3 Support<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># Test TLS 1.3 connection\ncurl -Iv --tlsv1.3 https:\/\/unify.smsgateway.center\n\n# Expected output should show TLSv1.3<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Send SMS with TLS 1.3<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\n\n# SMS Gateway Center API - TLS 1.3\nAPI_URL=\"https:\/\/unify.smsgateway.center\/SMSApi\/send\"\nAPI_KEY=\"YOUR_API_KEY\"\nUSER_ID=\"YOUR_USERNAME\"\nPASSWORD=\"YOUR_PASSWORD\"\nMOBILE=\"919876543210\"\nMESSAGE=\"Test message with TLS 1.3\"\nSENDER_ID=\"SGCSMS\"\nMSG_TYPE=\"text\"\nOUTPUT=\"json\"\n\n# Send SMS with TLS 1.3\ncurl --tlsv1.3 \\\n     -X POST \"$API_URL\" \\\n     -H \"apikey: $API_KEY\" \\\n     -H \"cache-control: no-cache\" \\\n     -H \"content-type: application\/x-www-form-urlencoded\" \\\n     -d \"userid=$USER_ID\" \\\n     -d \"password=$PASSWORD\" \\\n     -d \"sendMethod=quick\" \\\n     -d \"mobile=$MOBILE\" \\\n     -d \"msg=$MESSAGE\" \\\n     -d \"senderid=$SENDER_ID\" \\\n     -d \"msgType=$MSG_TYPE\" \\\n     -d \"duplicatecheck=true\" \\\n     -d \"output=$OUTPUT\" \\\n     --max-time 30 \\\n     --connect-timeout 10 \\\n     --verbose<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Testing &amp; Verification<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Quick TLS 1.3 Test<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># Test API endpoint with TLS 1.3\ncurl -Iv --tlsv1.3 https:\/\/unify.smsgateway.center\/SMSApi\/send\n\n# Expected output:\n# * TLSv1.3 (OUT), TLS handshake, Client hello (1):\n# * TLSv1.3 (IN), TLS handshake, Server hello (2):\n# * HTTP\/2 200<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Verify OpenSSL Version<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>openssl version\n# Should show: OpenSSL 1.1.1 or higher<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Troubleshooting<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Common Issues<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Issue 1: &#8220;SSL connection error&#8221; or &#8220;Handshake failure&#8221;<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Cause<\/strong>: System doesn&#8217;t support TLS 1.3<\/li>\n\n\n\n<li><strong>Solution<\/strong>: Upgrade OpenSSL to 1.1.1+ and your programming language to required version<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Issue 2: &#8220;Certificate verification failed&#8221;<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Cause<\/strong>: Missing CA certificates<\/li>\n\n\n\n<li><strong>Solution<\/strong>:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>  # Ubuntu\/Debian\n  sudo apt install ca-certificates\n  sudo update-ca-certificates<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Issue 3: cURL returns &#8220;unsupported protocol&#8221;<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Cause<\/strong>: cURL not compiled with TLS 1.3 support<\/li>\n\n\n\n<li><strong>Solution<\/strong>: Upgrade cURL to 7.52.0+ or compile from source<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Issue 4: PHP cURL doesn&#8217;t support TLS 1.3<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Cause<\/strong>: PHP compiled with old OpenSSL<\/li>\n\n\n\n<li><strong>Solution<\/strong>: Recompile PHP or use a newer PHP version from repository<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Support<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">For technical assistance with TLS 1.3 upgrade:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udce7 <strong>Email:<\/strong> contact@smsgatewaycenter.com<br>\ud83d\udcde <strong>Phone:<\/strong> +91-9930447726<br>\ud83d\udcac <strong>Live Chat:<\/strong> WhatsApp Us<br>\ud83d\udcda <strong>Knowledge Base:<\/strong> <a href=\"https:\/\/www.smsgatewaycenter.com\/blog\/kb\/\">https:\/\/www.smsgatewaycenter.com\/blog\/kb\/<\/a><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This guide provides step-by-step instructions for upgrading your system to support TLS 1.3 (Transport Layer Security version 1.3) for secure API communications with SMS Gateway Center. Official API Endpoint: https:\/\/unify.smsgateway.center\/SMSApi\/send TLS 1.3 Benefits: Minimum Acceptable Version: TLS 1.2Recommended Version: TLS 1.3Deadline for Upgrade: November 15, 2025 API Endpoint Information Base URL: https:\/\/unify.smsgateway.centerSend SMS Endpoint: \/SMSApi\/sendMethod: [&hellip;]<\/p>\n","protected":false},"author":118,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"doc_category":[1336],"doc_tag":[],"class_list":["post-2128","docs","type-docs","status-publish","hentry","doc_category-security"],"year_month":"2026-07","word_count":2646,"total_views":0,"reactions":{"happy":0,"normal":0,"sad":0},"author_info":{"name":"admin","author_nicename":"admin","author_url":"https:\/\/www.smsgatewaycenter.com\/blog\/author\/admin\/"},"doc_category_info":[{"term_name":"Security","term_url":"https:\/\/www.smsgatewaycenter.com\/blog\/kb-cat\/security\/"}],"doc_tag_info":[],"_links":{"self":[{"href":"https:\/\/www.smsgatewaycenter.com\/blog\/wp-json\/wp\/v2\/docs\/2128","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.smsgatewaycenter.com\/blog\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/www.smsgatewaycenter.com\/blog\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/www.smsgatewaycenter.com\/blog\/wp-json\/wp\/v2\/users\/118"}],"replies":[{"embeddable":true,"href":"https:\/\/www.smsgatewaycenter.com\/blog\/wp-json\/wp\/v2\/comments?post=2128"}],"version-history":[{"count":0,"href":"https:\/\/www.smsgatewaycenter.com\/blog\/wp-json\/wp\/v2\/docs\/2128\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.smsgatewaycenter.com\/blog\/wp-json\/wp\/v2\/media?parent=2128"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/www.smsgatewaycenter.com\/blog\/wp-json\/wp\/v2\/doc_category?post=2128"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/www.smsgatewaycenter.com\/blog\/wp-json\/wp\/v2\/doc_tag?post=2128"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}