Code example for SSLSocket

Methods: setEnabledProtocols, startHandshake

0
            openSslSocket.setEnabledCompressionMethods(new String[] { "ZLIB"});
            openSslSocket.setUseSessionTickets(true);
            openSslSocket.setHostname(address.socketHost);
            // use SSLSocketFactory default enabled protocols 
        } else { 
            unverifiedSocket.setEnabledProtocols(new String [] { "SSLv3" });
        } 
        // force handshake, which can throw 
        unverifiedSocket.startHandshake();
    } 
 
    /** 
     * Return an {@code SSLSocket} that is not only connected but has 
     * also passed hostname verification. 
     * 
     * @param hostnameVerifier Used to verify the hostname we 
     * connected to is an acceptable match for the peer certificate 
     * chain of the SSLSession. 
     */ 
    public SSLSocket verifySecureSocketHostname(HostnameVerifier hostnameVerifier)
            throws IOException {