function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Secure Http Request With SSL SNI Certificate



We have just deployed some Https Webservice that are certified with SSL through reverse proxy that supports SNI (


With the simple Outbound Message it works fine, but with WebserviceCallout or with HttpRequest we got the following error :

-IO Exception: No subject alternative DNS name matching "Server Name" found.



Do the both mecanisms (OutboundMessage and HttpRequest) have different libraries underneath ?


Thank you,




Hi , 



For more info ,please refer to below link :|StartTopic=Content%2Fapex_callouts_wsdl2apex.htm|SkinName=webhelp 


For that, you need to pass Certificate (Base64 converted value ) into the attribute :





docSample.DocSamplePort stub = new docSample.DocSamplePort();
stub.clientCert_x =


Thank you for your answer, but I think it is not related.


We do One way SSL authentication, so there is no need of client certificate.


See this sample code :


HttpRequest req = new HttpRequest();
Http http = new Http();
     HTTPResponse res = http.send(req);

 The error returned is :

IO Exception: No subject alternative DNS name matching "Server Name" found.


This is because SNI (see wiki link) can return a different certificate for the same IP.


I know that Java 7 support SSL SNI, but not Java 6.



Arnt mongoDBArnt mongoDB

we ran into the same issue. Our IT fixed it somehow on their server by installing another cert. Our CTO raised an eyebrow about the salesforce SSL implementation (apparently still using Java6 was his assumption?)

Thanks for the information :)
Arnt mongoDBArnt mongoDB
one more detail: we now call the server by the domain that matches the domain on the default certificate, so that it works even without SNI, which sfdc apparently doesn't support for apex callouts. Not a viable workaround in all environments maybe, but worked for us.
Jesper Kristensen 5Jesper Kristensen 5
I ran into the same problem today. Salesforce, can you confirm that you do not support SNI in Apex callouts? Any plans to fix this?
Would really just like the official confirmation that SNI is not supported for Apex callouts. Salesforce devs, can you comment?
Steven LawranceSteven Lawrance
I just now saw this post, and I have good news to share. Salesforce has been using SNI in its callouts since the Summer '15 release earlier this year.