- All Implemented Interfaces:
- org.apache.http.conn.socket.ConnectionSocketFactory, org.apache.http.conn.socket.LayeredConnectionSocketFactory
public class SniSSLConnectionSocketFactory
extends org.apache.http.conn.ssl.SSLConnectionSocketFactory
Class to work around the exception thrown by the SSL subsystem when the server is incorrectly
configured for SNI. In this case, it may return a warning: "handshake alert: unrecognized_name".
Browsers usually ignore this warning, while Java SSL throws an exception.
This class extends the SSLConnectionSocketFactory to remove the hostname used in the request,
which
basically disabled SNI for this host.
Based on the code provided by Ivan Shcheklein, available at:
http://stackoverflow.com/questions/7615645/ssl-handshake-alert-unrecognized-name-error-since
-upgrade-to-java-1-7-0/28571582#28571582