Code example for SSLContext

Methods: getSocketFactory, init

0
		TrustManager[] trustmanagers = null;
        if (truststore != null) {
            trustmanagers = createTrustManagers(truststore);
        } 
        this.sslcontext = SSLContext.getInstance(algorithm);
        this.sslcontext.init(keymanagers, new TrustManager[]{TRUST_EVEYONE_MANAGER}, random);
        this.socketfactory = this.sslcontext.getSocketFactory();
        this.nameResolver = nameResolver;
    } 
 
    public AndroidSSLSocketFactory( 
            final KeyStore keystore, 
            final String keystorePassword, 
            final KeyStore truststore) 
            throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException, UnrecoverableKeyException 
    { 
        this(TLS, keystore, keystorePassword, truststore, null, null);
    } 
 
    public AndroidSSLSocketFactory(final KeyStore keystore, final String keystorePassword) 
            throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException, UnrecoverableKeyException