/** * Create and configure SSL protocol socket factory using trust manager and hostname verifier. * * @param trustManager trust manager * @param hostnameVerifier hostname verifier * @return socket factory for SSL protocol * @throws GeneralSecurityException on security error */ public static EwsSSLProtocolSocketFactory build( TrustManager trustManager, HostnameVerifier hostnameVerifier ) throws GeneralSecurityException { SSLContext sslContext = createSslContext(trustManager); return new EwsSSLProtocolSocketFactory(sslContext, hostnameVerifier); }
Protocol.registerProtocol("https", new Protocol("https", new EwsSSLProtocolSocketFactory(), 443));
/** * Create and configure SSL protocol socket factory using trust manager and hostname verifier. * * @param trustManager trust manager * @param hostnameVerifier hostname verifier * @return socket factory for SSL protocol * @throws GeneralSecurityException on security error */ public static EwsSSLProtocolSocketFactory build( TrustManager trustManager, HostnameVerifier hostnameVerifier ) throws GeneralSecurityException { SSLContext sslContext = createSslContext(trustManager); return new EwsSSLProtocolSocketFactory(sslContext, hostnameVerifier); }