public SSLSocketFactory createSslSocketFactory ( ) { try { SSLContext sslContext = SSLContext . getInstance ( "TLS" ) ; sslContext . init ( null , new TrustManager [ ] { this } , null ) ; return sslContext . getSocketFactory ( ) ; } catch ( NoSuchAlgorithmException | KeyManagementException e ) { throw new AssertionError ( e ) ; } }
Creates a new SSL socket factory that generates SSL sockets that trust all certificates unconditionally .