Examples of SSLSession


Examples of com.firefly.net.tcp.ssl.SSLSession

  public void sessionOpened(Session session) throws Throwable {
    SessionAttachment sessionAttachment = new SessionAttachment();
    session.attachObject(sessionAttachment);
    Monitor.CONN_COUNT.incrementAndGet();
    if(sslContext != null) {
      sessionAttachment.sslSession = new SSLSession(sslContext, session);
    }
    httpConnectionListener.connectionCreated(session);
  }
View Full Code Here

Examples of javax.net.ssl.SSLSession

        SslHttpChannelEndPoint sslHttpChannelEndpoint=(SslHttpChannelEndPoint)endpoint;
        SSLEngine sslEngine=sslHttpChannelEndpoint.getSSLEngine();

        try
        {
            SSLSession sslSession=sslEngine.getSession();
            String cipherSuite=sslSession.getCipherSuite();
            Integer keySize;
            X509Certificate[] certs;

            CachedInfo cachedInfo=(CachedInfo)sslSession.getValue(CACHED_INFO_ATTR);
            if (cachedInfo!=null)
            {
                keySize=cachedInfo.getKeySize();
                certs=cachedInfo.getCerts();
            }
            else
            {
                keySize=new Integer(ServletSSL.deduceKeyLength(cipherSuite));
                certs=getCertChain(sslSession);
                cachedInfo=new CachedInfo(keySize,certs);
                sslSession.putValue(CACHED_INFO_ATTR,cachedInfo);
            }

            if (certs!=null)
                request.setAttribute("javax.servlet.request.X509Certificate",certs);
View Full Code Here

Examples of javax.net.ssl.SSLSession

  
    protected void doStart() throws Exception
    {
        _context=createSSLContext();
        SSLEngine engine=_context.createSSLEngine();
        SSLSession session=engine.getSession();
        if (getHeaderBufferSize()<session.getApplicationBufferSize())
            setHeaderBufferSize(session.getApplicationBufferSize());
        if (getRequestBufferSize()<session.getApplicationBufferSize())
            setRequestBufferSize(session.getApplicationBufferSize());
        super.doStart();
    }
View Full Code Here

Examples of javax.net.ssl.SSLSession

    public Certificate[] getClientCertificates() {
  if (getFilterChain().contains(SslFilter.class)) {
      SslFilter sslFilter = (SslFilter) getFilterChain().get(
        SslFilter.class);

      SSLSession sslSession = sslFilter.getSslSession(this);

      if (sslSession != null) {
    try {
        return sslSession.getPeerCertificates();
    } catch (SSLPeerUnverifiedException e) {
        // ignore, certificate will not be available to the session
    }
      }
View Full Code Here

Examples of javax.net.ssl.SSLSession

    protected void parseSocketInfo(Socket socket, WinstoneRequest req)
            throws IOException {
        super.parseSocketInfo(socket, req);
        if (socket instanceof SSLSocket) {
            SSLSocket s = (SSLSocket) socket;
            SSLSession ss = s.getSession();
            if (ss != null) {
                Certificate certChain[] = null;
                try {
                    certChain = ss.getPeerCertificates();
                } catch (Throwable err) {/* do nothing */
                }

                if (certChain != null) {
                    req.setAttribute("javax.servlet.request.X509Certificate",
                            certChain);
                    req.setAttribute("javax.servlet.request.cipher_suite", ss
                            .getCipherSuite());
                    req.setAttribute("javax.servlet.request.ssl_session",
                            new String(ss.getId()));
                    req.setAttribute("javax.servlet.request.key_size",
                            getKeySize(ss.getCipherSuite()));
                }
            }
            req.setIsSecure(true);
        }
    }
View Full Code Here

Examples of javax.net.ssl.SSLSession

   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

Examples of javax.net.ssl.SSLSession

      return socket;
   }

   public void handshakeCompleted(HandshakeCompletedEvent event)
   {
      SSLSession session = event.getSession();
      String sessionID = null;
      byte[] id = session.getId();
      try
      {
         sessionID = new String(id, "UTF-8");
      }
      catch (UnsupportedEncodingException e)
View Full Code Here

Examples of javax.net.ssl.SSLSession

   {
      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

Examples of javax.net.ssl.SSLSession

   }

   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

Examples of javax.net.ssl.SSLSession

      return ssf;
   }

   public static synchronized SSLSession getSSLSession(String sessionID)
   {
      SSLSession session = (SSLSession) sessionMap.get(sessionID);
      return session;
   }
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.