Using a custom SSLSocketFactory with Apache CXF

Java allows to use a custom VM-wide SSLSocketFactory implementation like so: HttpsURLConnection.setDefaultSSLSocketFactory(SSLSocketFactory). Thus, you can either implement your own SSLSocketFactory or you can configure a regular instance according to your needs/environment. You have to understand that there are probably very few use cases where this method actually really helps. Setting a static default SSLSocketFactory influences […]

Self signed certificates in Apache HttpClient

When you need to support self-signed SSL certificates in your Apache HttpClient based application you can use the contributed EasySSLProtocolSocketFactory as described in the HttpClient docs. Instead of using HttpClient’s HostConfiguration object directly you’d modify its protocol socket factory in your code like so:

Somewhere you’d instantiate a HttpClient object. Then you get its […]