Twilio API Certificate Update on May 31, 2016

Summary

On May 31, 2016 we’ll be updating our https://api.twilio.com certificate with a 2048 bit root certificate, an incremental improvement in encryption technology. This is an upgrade from the certificate we deployed in December 2015.

Though the vast majority of applications will not be impacted in any way, there is a possibility that clients or servers using or pinning older SSL certificate stores may run into compatibility issues.

To verify that your application is compatible with the new certificate, we’ve provided a test API endpoint at https://api.twilio.com:8443. Please note this endpoint uses a different port from the current default port of 443—make sure you specify that port in your Twilio SDK.

The validation endpoint will be deprecated on May 31, 2016 when the new 2048 bit root certificate is deployed to the main Twilio API endpoint (port 443).

Testing Your Environment

The best way to see if your environment is impacted by the certificate change is by performing a test command to our endpoint outlined above (https://api.twilio.com:8443). If your command successfully tests the endpoint, no changes will be needed on your end for the upcoming certificate change.

If your command fails, then outside of syntax errors, you are likely missing our new root certificate. Please, ensure the Thawte Primary Root CA is available in your local trust store: https://www.thawte.com/roots/thawte_Primary_Root_CA.pem

Helper Libraries for Testing

PHP

<?php
// this line loads the library
require('/path/to/twilio-php/Services/Twilio.php');
$account_sid = 'YOUR_ACCOUNT_SID';
$auth_token = 'YOUR_AUTH_TOKEN';
class Services_Twilio_port_8443 extends Services_Twilio  
     {    
          protected function _getBaseUri() {      
               return 'https://api.twilio.com:8443';    
          }  
      }
$client = new Services_Twilio_port_8443($account_sid, $auth_token);
$client->account->messages->create(array(    
     'To' => "TO_PHONE_NUMBER",    
     'From' => "FROM_PHONE_NUMBER",    
     'Body' => "Your system is ready for the upcoming change to the Twilio API's SSL certificate. No further action is needed"
));

cURL

curl -X POST 'https://api.twilio.com:8443/2010-04-01/Accounts/[YOUR_ACCOUNT_SID]/Messages.json'
--data-urlencode 'To=TO_PHONE_NUMBER'
--data-urlencode 'From=FROM_PHONE_NUMBER'
--data-urlencode 'Body=Your system is ready for the upcoming change to the Twilio API SSL certificate. No further action is needed.'
-u [YOUR_ACCOUNT_SID]:[AuthToken]

C#

var client = new TwilioRestClient(    
      "[YOUR_ACCOUNT_SID]",    
      "[YOUR_AUTH_TOKEN]",    
      "[YOUR_ACCOUNT_SID]",    
      "2010-04-01",   
      "https://api.twilio.com:8443/");           

var result = client.SendMessage("[FROM_PHONE_NUMBER]", "[TO_PHONE_NUMBER]", "Your system is ready for the upcoming change to the Twilio API's SSL certificate. No further action is needed");

Python

from twilio.rest import TwilioRestClient

ACCOUNT_SID = "[YOUR_ACCOUNT_SID]"
AUTH_TOKEN = "[YOUR_AUTH_TOKEN]"
TWILIO_NUMBER = "FROM_PHONE_NUMBER"
NUMBER_TO_TEXT = "TO_PHONE_NUMBER"

client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN, base="https://api.twilio.com:8443")
client.messages.create(from_=TWILIO_NUMBER, to=NUMBER_TO_TEXT, body="Your system is ready for the upcoming change to the Twilio API's SSL certificate. No further action is needed.")

Java

// You may want to be more specific in your imports
import java.util.*;
import com.twilio.sdk.*;
import com.twilio.sdk.resource.factory.*;
import com.twilio.sdk.resource.instance.*;
import com.twilio.sdk.resource.list.*;

public class App { 
     // Find your Account Sid and Token at twilio.com/user/account 
     public static final String ACCOUNT_SID = "[YOUR_ACCOUNT_SID]";
     public static final String AUTH_TOKEN = "[YOUR_AUTH_TOKEN]";
     
     public static void main(String[]args) throws TwilioRestException {  
      TwilioRestClient client = newTwilioRestClient(ACCOUNT_SID, AUTH_TOKEN, "https://api.twilio.com:8443");   
       
       // Build the parameters   List params = new ArrayList();   params.add(new
       BasicNameValuePair("To", "TO_PHONE_NUMBER"));   
       params.add(new BasicNameValuePair("From", "FROM_PHONE_NUMBER"));   
       params.add(new BasicNameValuePair("Body", "Your system is ready for the upcoming change to the Twilio API's SSL certificate. No further action is needed."));   

       MessageFactory messageFactory = client.getAccount().getMessageFactory();   
       Message message = messageFactory.create(params);
       System.out.println(message.getSid()); 
      }
     }

Ruby

require 'rubygems' # not necessary with ruby 1.9 but included for completeness
require 'twilio-ruby'

# put your own credentials here
account_sid = '[YOUR_ACCOUNT_SID]'
auth_token = '[YOUR_AUTH_TOKEN]'

# set up a client to talk to the Twilio REST API
@client = Twilio::REST::Client.new account_sid, auth_token, :host => "api.twilio.com", :port => 8443

@client.account.messages.create({
  :from => 'FROM_PHONE_NUMBER',
  :to => 'TO_PHONE_NUMBER',
  :body => 'Your system is ready for the upcoming change to the Twilio API's SSL certificate. No further action is needed.'
})

Node.js

// Twilio Credentials
var accountSid = '[YOUR_ACCOUNT_SID]';
var authToken = '[YOUR_AUTH_TOKEN]';

//require the Twilio module and create a REST client
var client = require('twilio')(accountSid, authToken, 'api.twilio.com:8443');

client.messages.create({
to: "TO_PHONE_NUMBER",
from: "FROM_PHONE_NUMBER",
body: "Your system is ready for the upcoming change to the Twilio API's SSL certificate. No further action is needed."
}, function(err, message) {
console.log(message.sid);
});

If you have any questions, please contact Customer Support.

Have more questions? Submit a request
Powered by Zendesk