Examples of SSLSession


Examples of javax.net.ssl.SSLSession

    private void verifyHostname(SSLSocket socket)
        throws SSLPeerUnverifiedException, UnknownHostException {
        if (! verifyHostname)
            return;

        SSLSession session = socket.getSession();
        String hostname = session.getPeerHost();
        try {
            InetAddress addr = InetAddress.getByName(hostname);
        } catch (UnknownHostException uhe) {
            throw new UnknownHostException("Could not resolve SSL sessions "
                                           + "server hostname: " + hostname);
        }
       
        X509Certificate[] certs = session.getPeerCertificateChain();
        if (certs == null || certs.length == 0)
            throw new SSLPeerUnverifiedException("No server certificates found!");
       
        //get the servers DN in its string representation
        String dn = certs[0].getSubjectDN().getName();
View Full Code Here

Examples of javax.net.ssl.SSLSession

            if( initialHandshakeStatus == SSLEngineResult.HandshakeStatus.FINISHED )
            {
                session.setAttribute( SSLFilter.SSL_SESSION, sslEngine.getSession() );
                if( log.isDebugEnabled() )
                {
                    SSLSession sslSession = sslEngine.getSession();
                    log.debug( session + "  initialHandshakeStatus=FINISHED" );
                    log.debug( session + "  sslSession CipherSuite used " + sslSession.getCipherSuite() );
                }
                initialHandshakeComplete = true;
                return;
            }
            else if( initialHandshakeStatus == SSLEngineResult.HandshakeStatus.NEED_TASK )
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.