private SSLSocketFactory createFactory ( ) throws Exception { SSLSocketFactory ssFactory = null ; String host = "localhost" ; int port = 8086 ; if ( _keyStore == null ) { return createAnonymousFactory ( null , port ) ; } SSLContext sslContext = SSLContext . getInstance ( _sslContext ) ; KeyManagerFactory kmf = KeyManagerFactory . getInstance ( keyManagerFactory ( ) ) ; kmf . init ( _keyStore , keyStorePassword ( ) . toCharArray ( ) ) ; sslContext . init ( kmf . getKeyManagers ( ) , null , null ) ; /* if (_cipherSuites != null) sslContext.createSSLEngine().setEnabledCipherSuites(_cipherSuites); */ SSLEngine engine = sslContext . createSSLEngine ( ) ; _enabledProtocols = enabledProtocols ( engine . getEnabledProtocols ( ) ) ; engine . setEnabledProtocols ( _enabledProtocols ) ; ssFactory = sslContext . getSocketFactory ( ) ; return ssFactory ; }
Creates the SSLSocketFactory