org.jsslutils.extra.apachetomcat5
Class JSSLutilsJSSESocketFactory

java.lang.Object
  extended by org.apache.tomcat.util.net.ServerSocketFactory
      extended by org.jsslutils.extra.apachetomcat5.JSSLutilsJSSESocketFactory
All Implemented Interfaces:
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  String clientAuth
           
protected  String[] enabledCiphers
           
protected  boolean initialized
           
protected  boolean requireClientAuth
          Flag to state that we require client authentication.
protected  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
 Socket acceptSocket(ServerSocket socket)
           
protected  void configureClientAuth(SSLServerSocket socket)
          Configure Client authentication for this version of JSSE.
protected  void configureClientAuth(SSLSocket socket)
          Configure Client authentication for this version of JSSE.
 ServerSocket createSocket(int port)
           
 ServerSocket createSocket(int port, int backlog)
           
 ServerSocket createSocket(int port, int backlog, InetAddress ifAddress)
           
protected  String[] getEnabledCiphers(String requestedCiphers, String[] supportedCiphers)
           
protected  String[] getEnabledProtocols(SSLServerSocket socket, String requestedProtocols)
          Determines the SSL protocol variants to be enabled.
 void handshake(Socket sock)
           
protected  void setEnabledProtocols(SSLServerSocket socket, 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 String clientAuth

sslProxy

protected SSLServerSocketFactory sslProxy

enabledCiphers

protected 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 ServerSocket createSocket(int port)
                          throws IOException
Specified by:
createSocket in class org.apache.tomcat.util.net.ServerSocketFactory
Throws:
IOException

createSocket

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

createSocket

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

acceptSocket

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

handshake

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

getEnabledCiphers

protected String[] getEnabledCiphers(String requestedCiphers,
                                     String[] supportedCiphers)

setEnabledProtocols

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

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

getEnabledProtocols

protected String[] getEnabledProtocols(SSLServerSocket socket,
                                       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(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(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 © 2012. All Rights Reserved.