Code example for SSLSocket

Methods: close

0
         * back to the underlying connection. RI close the ssl socket but 
         * dosen't reverts to former socket when invoke this method. We follow 
         * RI here. 
         */ 
        if (negotiatedSslSocket != null) {
            negotiatedSslSocket.close();
        } 
    } 
 
    @Override 
    public SSLSession negotiate() throws IOException {
        return negotiate(null); 
    } 
 
    @Override 
    public SSLSession negotiate(SSLSocketFactory factory) throws IOException {
 
        if (socket == null) {
            // must set socket before negotiate 
            return null; 
        }