Package javax.net.ssl

Examples of javax.net.ssl.SSLSession


                SSLTestContexts.createClientSSLContext());
        final Socket socket = socketFactory.createSocket(context);
        final InetSocketAddress remoteAddress = new InetSocketAddress("localhost", this.server.getLocalPort());
        final HttpHost target = new HttpHost("localhost", this.server.getLocalPort(), "https");
        final SSLSocket sslSocket = (SSLSocket) socketFactory.connectSocket(0, socket, target, remoteAddress, null, context);
        final SSLSession sslsession = sslSocket.getSession();
        Assert.assertNotNull(sslsession);
    }
View Full Code Here


        Result response = null;
        // If we already have a Principal from the SSLSession no need to continue with
        // username / password authentication.
        if (httpExchange instanceof HttpsExchange) {
            HttpsExchange httpsExch = (HttpsExchange) httpExchange;
            SSLSession session = httpsExch.getSSLSession();
            if (session != null) {
                try {
                    Principal p = session.getPeerPrincipal();

                    response = new Success(new HttpPrincipal(p.getName(), realm));
                } catch (SSLPeerUnverifiedException e) {
                }
            }
View Full Code Here

        Result response = null;
        // If we already have a Principal from the SSLSession no need to continue with
        // username / password authentication.
        if (httpExchange instanceof HttpsExchange) {
            HttpsExchange httpsExch = (HttpsExchange) httpExchange;
            SSLSession session = httpsExch.getSSLSession();
            if (session != null) {
                try {
                    Principal p = session.getPeerPrincipal();

                    response = new Success(new HttpPrincipal(p.getName(), realmName));
                } catch (SSLPeerUnverifiedException e) {
                }
            }
View Full Code Here

        }

        Result response = null;
        if (exchange instanceof HttpsExchange) {
            HttpsExchange httpsExch = (HttpsExchange) exchange;
            SSLSession session = httpsExch.getSSLSession();
            if (session != null) {
                try {
                    Principal p = session.getPeerPrincipal();

                    response = new Success(new HttpPrincipal(p.getName(), realm));

                } catch (SSLPeerUnverifiedException e) {
                }
View Full Code Here

   {
      Logger log = Logger.getLogger(ClientSocketFactory.class);
      if( log.isTraceEnabled() )
      {
         String cipher = event.getCipherSuite();
         SSLSession session = event.getSession();
         String peerHost = session.getPeerHost();
         log.debug("SSL handshakeCompleted, cipher="+cipher
            +", peerHost="+peerHost);
      }

      /* See if there is a HANDSHAKE_COMPLETE_LISTENER. This is not done from
View Full Code Here

   }

   public void handshakeCompleted(HandshakeCompletedEvent event)
   {
      String cipher = event.getCipherSuite();
      SSLSession session = event.getSession();
      String peerHost = session.getPeerHost();
      Certificate[] localCerts = event.getLocalCertificates();
      Certificate[] peerCerts = null;
      try
      {
         peerCerts = event.getPeerCertificates();
View Full Code Here

      return ssf;
   }

   public static synchronized SSLSession getSSLSession(String sessionID)
   {
      SSLSession session = (SSLSession) sessionMap.get(sessionID);
      return session;
   }
View Full Code Here

      return session;
   }

   static synchronized SSLSession putSSLSession(String sessionID, SSLSession session)
   {
      SSLSession prevSession = (SSLSession) sessionMap.put(sessionID, session);
      return prevSession;
   }
View Full Code Here

      return prevSession;
   }

   static synchronized SSLSession removeSSLSession(String sessionID)
   {
      SSLSession session = (SSLSession) sessionMap.remove(sessionID);
      return session;
   }
View Full Code Here

   public void handshakeCompleted(HandshakeCompletedEvent event)
   {
      if( log.isTraceEnabled() )
      {
         String cipher = event.getCipherSuite();
         SSLSession session = event.getSession();
         String peerHost = session.getPeerHost();
         log.debug("SSL handshakeCompleted, cipher="+cipher
            +", peerHost="+peerHost);
      }

      /* See if there is a HANDSHAKE_COMPLETE_LISTENER. This is not done from
View Full Code Here

TOP

Related Classes of javax.net.ssl.SSLSession

Copyright © 2018 www.massapicom. 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.