org.apache.commons.ssl
Interface SSLWrapperFactory


public interface SSLWrapperFactory

Since:
19-Sep-2006
Author:
Credit Union Central of British Columbia, www.cucbc.com, juliusdavies@cucbc.com

Field Summary
static SSLWrapperFactory DUMB_WRAP
          DUMB_WRAP is useful to make sure that wrapping the sockets doesn't break anything.
static SSLWrapperFactory NO_WRAP
          NO_WRAP doesn't wrap the SSLSocket.
 
Method Summary
 java.net.Socket wrap(java.net.Socket s)
          Wraps an SSLSSocket.
 javax.net.ssl.SSLServerSocket wrap(javax.net.ssl.SSLServerSocket s, SSL ssl)
          Wraps an SSLServerSocket.
 

Field Detail

NO_WRAP

static final SSLWrapperFactory NO_WRAP
NO_WRAP doesn't wrap the SSLSocket. It does wrap the SSLServerSocket so that we can do the usual housekeeping after accept() that we like to do on every socket. E.g. setSoTimeout, setEnabledProtocols, setEnabledCiphers, setUseClientMode, and the hostname verifier (which should be very rare on SSLServerSockets!).


DUMB_WRAP

static final SSLWrapperFactory DUMB_WRAP
DUMB_WRAP is useful to make sure that wrapping the sockets doesn't break anything. It doesn't actually do anything interesting in its wrapped implementations.

Method Detail

wrap

java.net.Socket wrap(java.net.Socket s)
                     throws java.io.IOException
Wraps an SSLSSocket.

Parameters:
s - SSLSocket to wrap.
Returns:
The new wrapped SSLSocket.
Throws:
java.io.IOException - if wrapping failed

wrap

javax.net.ssl.SSLServerSocket wrap(javax.net.ssl.SSLServerSocket s,
                                   SSL ssl)
                                   throws java.io.IOException
Wraps an SSLServerSocket.

Parameters:
s - The SSLServerSocket to wrap.
ssl - The SSL object that created the SSLServerSocket. This way some important commons-ssl config can be applied to the returned socket.
Returns:
The new wrapped SSLServerSocket.
Throws:
java.io.IOException - if wrapping failed