2

I have set up an API endpoint on my Digital Ocean VPS to receive incoming SMS to my Twilio number. It was working.

Then I started using CloudFlare. I believe that it stopped working after that, but since I receive SMS so infrequently, I am not absolutely sure. Although Twilio's website indicates that they sent an HTTP request and received a 502 Bad Gateway error, my server logs never registered any incoming requests from Twilio. I know that my API endpoint works because when I manually enter the API endpoint in my Chrome browser, my server receives it and logs the GET request as expected.

I tried asking Twilio's support for the full details of the supposedly failed request, but they refuse to give it to me.

Does anyone know which setting in CloudFlare to adjust that may fix this? I've tried turning off and reducing all the security settings as I thought it may be a firewall issue. How else can I go about debugging this problem without turning off CloudFlare completely (I need it on for other purposes)? I will accept the first answer or advice that leads to the solution. Thanks!

EDIT: this is the response from CloudFlare

One thing to ask them, is whether they support the SSL configuration of Universal SSL - which uses SNI and ECDSA. We have seen instances of 3rd party services not supporting one or both of these, and therefore failing to make calls via HTTPS.

Universal SSL support is defined by the client machine's support for two newer features:

Server Name Indication (SNI) Elliptic Curve certificates (ECDSA) What browsers work with Universal SSL?

If you need broader browser compatibility for older browsers/operating systems, our Pro plan plan provides this.

Also, if you want to get full information about what your browser supports, this site will run a check on your browser and tell you the support your browser has for protocols, ciphers and SNI:

https://cc.dcsec.uni-hannover.de/

FullStack
  • 5,902
  • 4
  • 43
  • 77
  • Hey, I'm a developer evangelist for Twilio. I'm sad that things have stopped working for you, but I'm not sure I can fix this over StackOverflow. Could you email me a message SID that failed to come through or your Account SID to philnash@twilio.com and I'll see what I can do! – philnash Jul 28 '15 at 15:44

2 Answers2

2

Twilio developer evangelist here.

Good news, Twilio now supports SNI! So, this should no longer be a problem.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
philnash
  • 70,667
  • 10
  • 60
  • 88
0

You might want to check Server Name Indication (SNI) Twilio does not support this, so as a result you get 502 Bad Gateway. Same thing was happening to me. I was able to fix this using Cloud flare Pro see this post Twilio - TwiML with SNI Support

ecorvo
  • 3,559
  • 4
  • 24
  • 35
  • When you upgrade, did it just started working again as is, or did you have to reconfigure anything more? – FullStack Aug 07 '15 at 02:32