Search code examples
coldfusionssl-certificatecoldfusion-10cfhttp

ColdFusion - CFHTTP cannot connect to secure website with SSL certificate from Cloudflare


I have this code:

<cfhttp url="#qCheckSiteID.url#">
<cfdump var="#cfhttp#" />

Which works fine with any HTTP urls but not for HTTPS. For example it works ok with https://www.google.com but with https://mywebsite.com which has an SSL Certificate under CloudFlare it fails with error:

I/O Exception: Name in certificate "ssl2000.cloudflare.com" does not match host name "www.mywebsite.com".

Any ideas how to get passed this error?


Solution

  • Cloudflare uses SNI (server name indication) for offering SSL certificates in their free tier. What this means is that these sites do not have a unique IP address, but they rely on the HTTP client to use the TLS extension SNI to send the hostname for SSL to work properly. This works fine on most browsers in use today, but it does fail on some: https://support.cloudflare.com/hc/en-us/articles/203041594-What-browsers-work-with-Universal-SSL-

    Further for CFHTTP to work with SNI, it requires that you are running Java 1.7 or greater. Java 1.7 is supported on fully Patched CF9,10,11 servers. Java 8 is supported on fully patched CF10,11 servers currently.

    If you have never updated Java on your ColdFusion server then you are probably running Java 1.6 or lower (unless you are running CF11).

    Here is a video showing how to update Java on a ColdFusion 10 server: https://www.youtube.com/watch?v=zzC31EAlZ8Y

    You might still be able to get CF8 and lower working on Java 1.7+ but you might run into issues, but if you are running CF8 and lower you should consider upgrading because Adobe no longer supports CF9 and below.