org.jsslutils.extra.apachetomcat6
Class JSSLutilsJSSESocketFactory

java.lang.Object
  extended by org.apache.tomcat.util.net.ServerSocketFactory
      extended by org.jsslutils.extra.apachetomcat6.JSSLutilsJSSESocketFactory
All Implemented Interfaces:
java.lang.Cloneable

public class JSSLutilsJSSESocketFactory
extends org.apache.tomcat.util.net.ServerSocketFactory

This socket factory is used by the jSSLutils SSLImplementation; it is derived from the default JSSESocketFactory provided with Tomcat 6. This is an example for using jSSLutils with Tomcat 6. It takes the same parameters as the default factory in Tomcat 6, with the addition of:

Author:
Harish Prabandham, Costin Manolache, Stefan Freyr Stefansson, EKR -- renamed to JSSESocketFactory, Jan Luehe, Bill Barker, Bruno Harbulot -- jSSLutils

Field Summary
protected  java.lang.String clientAuth
           
protected  java.lang.String[] enabledCiphers
           
protected  boolean initialized
           
protected  boolean requireClientAuth
          Flag to state that we require client authentication.
protected  javax.net.ssl.SSLServerSocketFactory sslProxy
           
protected  boolean wantClientAuth
          Flag to state that we would like client authentication.
 
Fields inherited from class org.apache.tomcat.util.net.ServerSocketFactory
attributes
 
Constructor Summary
JSSLutilsJSSESocketFactory()
           
 
Method Summary
 java.net.Socket acceptSocket(java.net.ServerSocket socket)
           
protected  void configureClientAuth(javax.net.ssl.SSLServerSocket socket)
          Configure Client authentication for this version of JSSE.
protected  void configureClientAuth(javax.net.ssl.SSLSocket socket)
          Configure Client authentication for this version of JSSE.
 java.net.ServerSocket createSocket(int port)
           
 java.net.ServerSocket createSocket(int port, int backlog)
           
 java.net.ServerSocket createSocket(int port, int backlog, java.net.InetAddress ifAddress)
           
protected  java.lang.String[] getEnabledCiphers(java.lang.String requestedCiphers, java.lang.String[] supportedCiphers)
           
protected  java.lang.String[] getEnabledProtocols(javax.net.ssl.SSLServerSocket socket, java.lang.String requestedProtocols)
          Determines the SSL protocol variants to be enabled.
 void handshake(java.net.Socket sock)
           
protected  void setEnabledProtocols(javax.net.ssl.SSLServerSocket socket, java.lang.String[] protocols)
          Set the SSL protocol variants to be enabled.
 
Methods inherited from class org.apache.tomcat.util.net.ServerSocketFactory
getDefault, initSocket, setAttribute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

initialized

protected boolean initialized

clientAuth

protected java.lang.String clientAuth

sslProxy

protected javax.net.ssl.SSLServerSocketFactory sslProxy

enabledCiphers

protected java.lang.String[] enabledCiphers

requireClientAuth

protected boolean requireClientAuth
Flag to state that we require client authentication.


wantClientAuth

protected boolean wantClientAuth
Flag to state that we would like client authentication.

Constructor Detail

JSSLutilsJSSESocketFactory

public JSSLutilsJSSESocketFactory()
Method Detail

createSocket

public java.net.ServerSocket createSocket(int port)
                                   throws java.io.IOException
Specified by:
createSocket in class org.apache.tomcat.util.net.ServerSocketFactory
Throws:
java.io.IOException

createSocket

public java.net.ServerSocket createSocket(int port,
                                          int backlog)
                                   throws java.io.IOException
Specified by:
createSocket in class org.apache.tomcat.util.net.ServerSocketFactory
Throws:
java.io.IOException

createSocket

public java.net.ServerSocket createSocket(int port,
                                          int backlog,
                                          java.net.InetAddress ifAddress)
                                   throws java.io.IOException
Specified by:
createSocket in class org.apache.tomcat.util.net.ServerSocketFactory
Throws:
java.io.IOException

acceptSocket

public java.net.Socket acceptSocket(java.net.ServerSocket socket)
                             throws java.io.IOException
Specified by:
acceptSocket in class org.apache.tomcat.util.net.ServerSocketFactory
Throws:
java.io.IOException

handshake

public void handshake(java.net.Socket sock)
               throws java.io.IOException
Specified by:
handshake in class org.apache.tomcat.util.net.ServerSocketFactory
Throws:
java.io.IOException

getEnabledCiphers

protected java.lang.String[] getEnabledCiphers(java.lang.String requestedCiphers,
                                               java.lang.String[] supportedCiphers)

setEnabledProtocols

protected void setEnabledProtocols(javax.net.ssl.SSLServerSocket socket,
                                   java.lang.String[] protocols)
Set the SSL protocol variants to be enabled.

Parameters:
socket - the SSLServerSocket.
protocols - the protocols to use.

getEnabledProtocols

protected java.lang.String[] getEnabledProtocols(javax.net.ssl.SSLServerSocket socket,
                                                 java.lang.String requestedProtocols)
Determines the SSL protocol variants to be enabled.

Parameters:
socket - The socket to get supported list from.
requestedProtocols - Comma-separated list of requested SSL protocol variants
Returns:
Array of SSL protocol variants to be enabled, or null if none of the requested protocol variants are supported

configureClientAuth

protected void configureClientAuth(javax.net.ssl.SSLServerSocket socket)
Configure Client authentication for this version of JSSE. The JSSE included in Java 1.4 supports the 'want' value. Prior versions of JSSE will treat 'want' as 'false'.

Parameters:
socket - the SSLServerSocket

configureClientAuth

protected void configureClientAuth(javax.net.ssl.SSLSocket socket)
Configure Client authentication for this version of JSSE. The JSSE included in Java 1.4 supports the 'want' value. Prior versions of JSSE will treat 'want' as 'false'.

Parameters:
socket - the SSLSocket


Copyright © 2011. All Rights Reserved.