org.apache.commons.ssl
Class SSLServerSocketWrapper

java.lang.Object
  extended by java.net.ServerSocket
      extended by javax.net.ssl.SSLServerSocket
          extended by org.apache.commons.ssl.SSLServerSocketWrapper

public class SSLServerSocketWrapper
extends SSLServerSocket

Wraps an SSLServerSocket - NOTE that the accept() method applies a number of important common-ssl settings before returning the SSLSocket!

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

Field Summary
protected  SSLServerSocket s
           
protected  SSL ssl
           
protected  SSLWrapperFactory wf
           
 
Constructor Summary
SSLServerSocketWrapper(SSLServerSocket s, SSL ssl, SSLWrapperFactory wf)
           
 
Method Summary
 Socket accept()
           
 void bind(SocketAddress endpoint)
           
 void bind(SocketAddress ep, int bl)
           
 void close()
           
 ServerSocketChannel getChannel()
           
 String[] getEnabledCipherSuites()
           
 String[] getEnabledProtocols()
           
 boolean getEnableSessionCreation()
           
 InetAddress getInetAddress()
           
 int getLocalPort()
           
 SocketAddress getLocalSocketAddress()
           
 boolean getNeedClientAuth()
           
 int getReceiveBufferSize()
           
 boolean getReuseAddress()
           
 int getSoTimeout()
           
 String[] getSupportedCipherSuites()
           
 String[] getSupportedProtocols()
           
 boolean getUseClientMode()
           
 boolean getWantClientAuth()
           
 boolean isBound()
           
 boolean isClosed()
           
 void setEnabledCipherSuites(String[] suites)
           
 void setEnabledProtocols(String[] protocols)
           
 void setEnableSessionCreation(boolean flag)
           
 void setNeedClientAuth(boolean need)
           
 void setReceiveBufferSize(int size)
           
 void setReuseAddress(boolean on)
           
 void setSoTimeout(int timeout)
           
 void setUseClientMode(boolean use)
           
 void setWantClientAuth(boolean want)
           
 String toString()
           
 
Methods inherited from class java.net.ServerSocket
implAccept, setPerformancePreferences, setSocketFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

s

protected SSLServerSocket s

ssl

protected SSL ssl

wf

protected SSLWrapperFactory wf
Constructor Detail

SSLServerSocketWrapper

public SSLServerSocketWrapper(SSLServerSocket s,
                              SSL ssl,
                              SSLWrapperFactory wf)
                       throws IOException
Throws:
IOException
Method Detail

accept

public Socket accept()
              throws IOException
Overrides:
accept in class ServerSocket
Throws:
IOException

getEnabledCipherSuites

public String[] getEnabledCipherSuites()
Specified by:
getEnabledCipherSuites in class SSLServerSocket

getEnabledProtocols

public String[] getEnabledProtocols()
Specified by:
getEnabledProtocols in class SSLServerSocket

getEnableSessionCreation

public boolean getEnableSessionCreation()
Specified by:
getEnableSessionCreation in class SSLServerSocket

getNeedClientAuth

public boolean getNeedClientAuth()
Specified by:
getNeedClientAuth in class SSLServerSocket

getSupportedCipherSuites

public String[] getSupportedCipherSuites()
Specified by:
getSupportedCipherSuites in class SSLServerSocket

getSupportedProtocols

public String[] getSupportedProtocols()
Specified by:
getSupportedProtocols in class SSLServerSocket

getUseClientMode

public boolean getUseClientMode()
Specified by:
getUseClientMode in class SSLServerSocket

getWantClientAuth

public boolean getWantClientAuth()
Specified by:
getWantClientAuth in class SSLServerSocket

setEnabledCipherSuites

public void setEnabledCipherSuites(String[] suites)
Specified by:
setEnabledCipherSuites in class SSLServerSocket

setEnabledProtocols

public void setEnabledProtocols(String[] protocols)
Specified by:
setEnabledProtocols in class SSLServerSocket

setEnableSessionCreation

public void setEnableSessionCreation(boolean flag)
Specified by:
setEnableSessionCreation in class SSLServerSocket

setNeedClientAuth

public void setNeedClientAuth(boolean need)
Specified by:
setNeedClientAuth in class SSLServerSocket

setUseClientMode

public void setUseClientMode(boolean use)
Specified by:
setUseClientMode in class SSLServerSocket

setWantClientAuth

public void setWantClientAuth(boolean want)
Specified by:
setWantClientAuth in class SSLServerSocket

bind

public void bind(SocketAddress endpoint)
          throws IOException
Overrides:
bind in class ServerSocket
Throws:
IOException

bind

public void bind(SocketAddress ep,
                 int bl)
          throws IOException
Overrides:
bind in class ServerSocket
Throws:
IOException

close

public void close()
           throws IOException
Overrides:
close in class ServerSocket
Throws:
IOException

getChannel

public ServerSocketChannel getChannel()
Overrides:
getChannel in class ServerSocket

getInetAddress

public InetAddress getInetAddress()
Overrides:
getInetAddress in class ServerSocket

getLocalPort

public int getLocalPort()
Overrides:
getLocalPort in class ServerSocket

getLocalSocketAddress

public SocketAddress getLocalSocketAddress()
Overrides:
getLocalSocketAddress in class ServerSocket

getReceiveBufferSize

public int getReceiveBufferSize()
                         throws SocketException
Overrides:
getReceiveBufferSize in class ServerSocket
Throws:
SocketException

getReuseAddress

public boolean getReuseAddress()
                        throws SocketException
Overrides:
getReuseAddress in class ServerSocket
Throws:
SocketException

getSoTimeout

public int getSoTimeout()
                 throws IOException
Overrides:
getSoTimeout in class ServerSocket
Throws:
IOException

isBound

public boolean isBound()
Overrides:
isBound in class ServerSocket

isClosed

public boolean isClosed()
Overrides:
isClosed in class ServerSocket

setReceiveBufferSize

public void setReceiveBufferSize(int size)
                          throws SocketException
Overrides:
setReceiveBufferSize in class ServerSocket
Throws:
SocketException

setReuseAddress

public void setReuseAddress(boolean on)
                     throws SocketException
Overrides:
setReuseAddress in class ServerSocket
Throws:
SocketException

setSoTimeout

public void setSoTimeout(int timeout)
                  throws SocketException
Overrides:
setSoTimeout in class ServerSocket
Throws:
SocketException

toString

public String toString()
Overrides:
toString in class ServerSocket