org.apache.tomcat.util.net.jsse

Class JSSESocketFactory

Implemented Interfaces:
Cloneable
Known Direct Subclasses:
JSSE13SocketFactory, JSSE14SocketFactory

public abstract class JSSESocketFactory
extends ServerSocketFactory

SSL server socket factory. It _requires_ a valid RSA key and JSSE.

Authors:
Harish Prabandham
Costin Manolache
Stefan Freyr Stefansson
EKR -- renamed to JSSESocketFactory

Field Summary

protected String
clientAuth
protected String[]
enabledCiphers
protected boolean
initialized
protected SSLServerSocketFactory
sslProxy

Fields inherited from class org.apache.tomcat.util.net.ServerSocketFactory

attributes

Constructor Summary

JSSESocketFactory()
Constructor is used only by subclasses.

Method Summary

Socket
acceptSocket(ServerSocket socket)
Wrapper function for accept().
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)
Returns a server socket which uses all network interfaces on the host, and is bound to a the specified port.
ServerSocket
createSocket(int port, int backlog)
Returns a server socket which uses all network interfaces on the host, is bound to a the specified port, and uses the specified connection backlog.
ServerSocket
createSocket(int port, int backlog, InetAddress ifAddress)
Returns a server socket which uses only the specified network interface on the local host, is bound to a the specified port, and uses the specified connection backlog.
protected String[]
getEnabledCiphers(String requestedCiphers, String[] supportedCiphers)
protected String[]
getEnabledProtocols(SSLServerSocket socket, String requestedProtocols)
protected KeyStore
getKeystore(String type, String pass)
protected String
getKeystorePassword()
protected KeyStore
getTrustStore(String keystoreType)
void
handshake(Socket sock)
Extra function to initiate the handshake.
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

acceptSocket, createSocket, createSocket, createSocket, getDefault, handshake, initSocket, setAttribute

Field Details

clientAuth

protected String clientAuth


enabledCiphers

protected String[] enabledCiphers


initialized

protected boolean initialized


sslProxy

protected SSLServerSocketFactory sslProxy

Constructor Details

JSSESocketFactory

public JSSESocketFactory()
Constructor is used only by subclasses.

Method Details

acceptSocket

public Socket acceptSocket(ServerSocket socket)
            throws IOException
Wrapper function for accept(). This allows us to trap and translate exceptions if necessary
Overrides:
acceptSocket in interface ServerSocketFactory


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:


createSocket

public ServerSocket createSocket(int port)
            throws IOException
Returns a server socket which uses all network interfaces on the host, and is bound to a the specified port. The socket is configured with the socket options (such as accept timeout) given to this factory.
Overrides:
createSocket in interface ServerSocketFactory

Parameters:
port - the port to listen to


createSocket

public ServerSocket createSocket(int port,
                                 int backlog)
            throws IOException
Returns a server socket which uses all network interfaces on the host, is bound to a the specified port, and uses the specified connection backlog. The socket is configured with the socket options (such as accept timeout) given to this factory.
Overrides:
createSocket in interface ServerSocketFactory

Parameters:
port - the port to listen to
backlog - how many connections are queued


createSocket

public ServerSocket createSocket(int port,
                                 int backlog,
                                 InetAddress ifAddress)
            throws IOException
Returns a server socket which uses only the specified network interface on the local host, is bound to a the specified port, and uses the specified connection backlog. The socket is configured with the socket options (such as accept timeout) given to this factory.
Overrides:
createSocket in interface ServerSocketFactory

Parameters:
port - the port to listen to
backlog - how many connections are queued
ifAddress - the network interface address to use


getEnabledCiphers

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


getEnabledProtocols

protected String[] getEnabledProtocols(SSLServerSocket socket,
                                       String requestedProtocols)


getKeystore

protected KeyStore getKeystore(String type,
                               String pass)
            throws IOException


getKeystorePassword

protected String getKeystorePassword()


getTrustStore

protected KeyStore getTrustStore(String keystoreType)
            throws IOException


handshake

public void handshake(Socket sock)
            throws IOException
Extra function to initiate the handshake. Sometimes necessary for SSL
Overrides:
handshake in interface ServerSocketFactory


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.


Copyright B) 2000-2003 Apache Software Foundation. All Rights Reserved.