--- file_not_specified_in_diff +++ file_not_specified_in_diff @@ -49,6 +49,7 @@ import javax.net.ssl.SSLException; import javax.net.ssl.SSLServerSocket; import javax.net.ssl.SSLServerSocketFactory; +import javax.net.ssl.SSLSessionContext; import javax.net.ssl.SSLSocket; import javax.net.ssl.TrustManager; import javax.net.ssl.TrustManagerFactory; @@ -74,6 +75,7 @@ * @author EKR -- renamed to JSSESocketFactory * @author Jan Luehe * @author Bill Barker + * @author Chris Elving */ public class JSSESocketFactory extends org.apache.tomcat.util.net.ServerSocketFactory { @@ -380,6 +382,22 @@ getTrustManagers(keystoreType, trustAlgorithm), new SecureRandom()); + // Configure the optional server SSLSessionContext + String sslSessionCacheSize = (String) attributes.get("sslSessionCacheSize"); + String sslSessionTimeout = (String) attributes.get("sslSessionTimeout"); + if (sslSessionCacheSize != null || sslSessionTimeout != null) { + SSLSessionContext sessionContext = context.getServerSessionContext(); + if (sessionContext != null) { + if (sslSessionCacheSize != null) + sessionContext.setSessionCacheSize(Integer.parseInt(sslSessionCacheSize)); + if (sslSessionTimeout != null) + sessionContext.setSessionTimeout(Integer.parseInt(sslSessionTimeout)); + } else { + log.error(protocol + + " does not have a server SSL session context"); + } + } + // create proxy sslProxy = context.getServerSocketFactory();