Package javax.net.ssl

Examples of javax.net.ssl.SSLSessionContext


                // Initialize the SSLContext to work with the trust managers.
                ctx = SSLContext.getInstance(PROTOCOL);
                ctx.init(null, trustManagerFactory.getTrustManagers(), null);
            }

            SSLSessionContext sessCtx = ctx.getClientSessionContext();
            if (sessionCacheSize > 0) {
                sessCtx.setSessionCacheSize((int) Math.min(sessionCacheSize, Integer.MAX_VALUE));
            }
            if (sessionTimeout > 0) {
                sessCtx.setSessionTimeout((int) Math.min(sessionTimeout, Integer.MAX_VALUE));
            }
        } catch (Exception e) {
            throw new SSLException("failed to initialize the server-side SSL context", e);
        }
    }
View Full Code Here


            // Initialize the SSLContext to work with our key managers.
            ctx = SSLContext.getInstance(PROTOCOL);
            ctx.init(kmf.getKeyManagers(), null, null);

            SSLSessionContext sessCtx = ctx.getServerSessionContext();
            if (sessionCacheSize > 0) {
                sessCtx.setSessionCacheSize((int) Math.min(sessionCacheSize, Integer.MAX_VALUE));
            }
            if (sessionTimeout > 0) {
                sessCtx.setSessionTimeout((int) Math.min(sessionTimeout, Integer.MAX_VALUE));
            }
        } catch (Exception e) {
            throw new SSLException("failed to initialize the server-side SSL context", e);
        }
    }
View Full Code Here

//                try {
                    if (protocols[i].equals("SSLv2Hello")) {
                        continue;
                    }
                    SSLContext sslc = SSLContext.getInstance(protocols[i]);
                    SSLSessionContext sslsc = sslc.getServerSessionContext();
                    System.out.println("Protocol: " + protocols[i]);
                    sslsc.setSessionTimeout(Integer.MAX_VALUE);
                    int newtime = sslsc.getSessionTimeout();
                    if (newtime != Integer.MAX_VALUE) {
                        throw new Exception ("Expected timeout: " +
                            Integer.MAX_VALUE + ", got instead: " +
                            newtime);
                    }
View Full Code Here

/*     */     throws IOException
/*     */   {
/* 225 */     initSSLContext();
/* 226 */     SSLServerSocketFactory factory = this.sslCtx.getServerSocketFactory();
/* 227 */     SSLServerSocket socket = (SSLServerSocket)factory.createServerSocket(port, backlog, ifAddress);
/* 228 */     SSLSessionContext ctx = this.sslCtx.getServerSessionContext();
/* 229 */     System.out.println(ctx);
/* 230 */     if (log.isTraceEnabled())
/*     */     {
/* 232 */       String[] supportedProtocols = socket.getSupportedProtocols();
/* 233 */       log.debug("Supported protocols: " + Arrays.asList(supportedProtocols));
View Full Code Here

      throws IOException
   {
      initSSLContext();
      SSLServerSocketFactory factory = sslCtx.getServerSocketFactory();
      SSLServerSocket socket = (SSLServerSocket) factory.createServerSocket(port, backlog, ifAddress);
      SSLSessionContext ctx = sslCtx.getServerSessionContext();
      System.out.println(ctx);
      if( log.isTraceEnabled() )
      {
         String[] supportedProtocols = socket.getSupportedProtocols();
         log.debug("Supported protocols: " + Arrays.asList(supportedProtocols));
View Full Code Here

            sslContext = sslUtil.createSSLContext();
            sslContext.init(wrap(sslUtil.getKeyManagers()),
                    sslUtil.getTrustManagers(), null);

            SSLSessionContext sessionContext =
                sslContext.getServerSessionContext();
            if (sessionContext != null) {
                sslUtil.configureSessionContext(sessionContext);
            }
        }
View Full Code Here

            invalidateSession((SSLContext)_contextMaps.get(it.next()));
        }
    }
   
    private void invalidateSession(SSLContext sc) {
        SSLSessionContext sslsc = sc.getClientSessionContext();
        if (sslsc != null) {
            int timeout = sslsc.getSessionTimeout();
            // force sessions to be timed out
            sslsc.setSessionTimeout(1);
            sslsc.setSessionTimeout(timeout);
        }
        sslsc = sc.getServerSessionContext();
        if (sslsc != null) {
            int timeout = sslsc.getSessionTimeout();
            // force sessions to be timed out
            sslsc.setSessionTimeout(1);
            sslsc.setSessionTimeout(timeout);
        }
    }
View Full Code Here

            SSLContext context = createSSLContext();
            context.init(getKeyManagers(), getTrustManagers(), null);

            // Configure SSL session cache
            SSLSessionContext sessionContext =
                context.getServerSessionContext();
            if (sessionContext != null) {
                configureSessionContext(sessionContext);
            }
View Full Code Here

            sslContext = sslUtil.createSSLContext();
            sslContext.init(wrap(sslUtil.getKeyManagers()),
                    sslUtil.getTrustManagers(), null);

            SSLSessionContext sessionContext =
                sslContext.getServerSessionContext();
            if (sessionContext != null) {
                sslUtil.configureSessionContext(sessionContext);
            }
            // Determine which cipher suites and protocols to enable
View Full Code Here

            SSLContext context = createSSLContext();
            context.init(getKeyManagers(), getTrustManagers(), null);

            // Configure SSL session cache
            SSLSessionContext sessionContext =
                context.getServerSessionContext();
            if (sessionContext != null) {
                configureSessionContext(sessionContext);
            }
View Full Code Here

TOP

Related Classes of javax.net.ssl.SSLSessionContext

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.