This is org.apache.http.conn.ssl.SSLSocketFactory , which you should use, not javax.net.ssl.SSLSocketFactory (see the import directive in the example file that you use).
Note that the former has constructors that can use the latter if you already have code for this. However, you usually get a custom javax.net.ssl.SSLSocketFactory from SSLContext , so in this case you can use the SSLContext constructor.
Bruno source share