org.apache.commons.ssl

## Class SSLServerSocketWrapper

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

All Implemented Interfaces:
  java.io.Closeable, java.lang.AutoCloseable

    public class SSLServerSocketWrapper
    extends javax.net.ssl.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

Fields
`protected javax.net.ssl.SSLServerSocket` `s`
`protected SSL` `ssl`
`protected SSLWrapperFactory` `wf`

### Constructor Summary

Constructors
Constructor and Description
`SSLServerSocketWrapper(javax.net.ssl.SSLServerSocket s, SSL ssl, SSLWrapperFactory wf)`

### Method Summary

Methods
`java.net.Socket` `accept()`
`void` `bind(java.net.SocketAddress endpoint)`
`void` `bind(java.net.SocketAddress ep, int bl)`
`void` `close()`
`java.nio.channels.ServerSocketChannel` `getChannel()`
`java.lang.String[]` `getEnabledCipherSuites()`
`java.lang.String[]` `getEnabledProtocols()`
`boolean` `getEnableSessionCreation()`
`java.net.InetAddress` `getInetAddress()`
`int` `getLocalPort()`
`java.net.SocketAddress` `getLocalSocketAddress()`
`boolean` `getNeedClientAuth()`
`int` `getReceiveBufferSize()`
`boolean` `getReuseAddress()`
`int` `getSoTimeout()`
`java.lang.String[]` `getSupportedCipherSuites()`
`java.lang.String[]` `getSupportedProtocols()`
`boolean` `getUseClientMode()`
`boolean` `getWantClientAuth()`
`boolean` `isBound()`
`boolean` `isClosed()`
`void` `setEnabledCipherSuites(java.lang.String[] suites)`
`void` `setEnabledProtocols(java.lang.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)`
`java.lang.String` `toString()`

### Methods inherited from class javax.net.ssl.SSLServerSocket

`getSSLParameters, setSSLParameters`

### 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 javax.net.ssl.SSLServerSocket s

#### ssl

    protected SSL ssl

#### wf

    protected SSLWrapperFactory wf

### Constructor Detail

#### SSLServerSocketWrapper

    public SSLServerSocketWrapper(javax.net.ssl.SSLServerSocket s,
                          SSL ssl,
                          SSLWrapperFactory wf)
                           throws java.io.IOException

Throws:
  `java.io.IOException`

### Method Detail

#### accept

    public java.net.Socket accept()
                           throws java.io.IOException

Overrides:
  `accept` in class `java.net.ServerSocket`
Throws:
  `java.io.IOException`

#### getEnabledCipherSuites

    public java.lang.String[] getEnabledCipherSuites()

Specified by:
  `getEnabledCipherSuites` in class `javax.net.ssl.SSLServerSocket`

#### getEnabledProtocols

    public java.lang.String[] getEnabledProtocols()

Specified by:
  `getEnabledProtocols` in class `javax.net.ssl.SSLServerSocket`

#### getEnableSessionCreation

    public boolean getEnableSessionCreation()

Specified by:
  `getEnableSessionCreation` in class `javax.net.ssl.SSLServerSocket`

#### getNeedClientAuth

    public boolean getNeedClientAuth()

Specified by:
  `getNeedClientAuth` in class `javax.net.ssl.SSLServerSocket`

#### getSupportedCipherSuites

    public java.lang.String[] getSupportedCipherSuites()

Specified by:
  `getSupportedCipherSuites` in class `javax.net.ssl.SSLServerSocket`

#### getSupportedProtocols

    public java.lang.String[] getSupportedProtocols()

Specified by:
  `getSupportedProtocols` in class `javax.net.ssl.SSLServerSocket`

#### getUseClientMode

    public boolean getUseClientMode()

Specified by:
  `getUseClientMode` in class `javax.net.ssl.SSLServerSocket`

#### getWantClientAuth

    public boolean getWantClientAuth()

Specified by:
  `getWantClientAuth` in class `javax.net.ssl.SSLServerSocket`

#### setEnabledCipherSuites

    public void setEnabledCipherSuites(java.lang.String[] suites)

Specified by:
  `setEnabledCipherSuites` in class `javax.net.ssl.SSLServerSocket`

#### setEnabledProtocols

    public void setEnabledProtocols(java.lang.String[] protocols)

Specified by:
  `setEnabledProtocols` in class `javax.net.ssl.SSLServerSocket`

#### setEnableSessionCreation

    public void setEnableSessionCreation(boolean flag)

Specified by:
  `setEnableSessionCreation` in class `javax.net.ssl.SSLServerSocket`

#### setNeedClientAuth

    public void setNeedClientAuth(boolean need)

Specified by:
  `setNeedClientAuth` in class `javax.net.ssl.SSLServerSocket`

#### setUseClientMode

    public void setUseClientMode(boolean use)

Specified by:
  `setUseClientMode` in class `javax.net.ssl.SSLServerSocket`

#### setWantClientAuth

    public void setWantClientAuth(boolean want)

Specified by:
  `setWantClientAuth` in class `javax.net.ssl.SSLServerSocket`

#### bind

    public void bind(java.net.SocketAddress endpoint)
              throws java.io.IOException

Overrides:
  `bind` in class `java.net.ServerSocket`
Throws:
  `java.io.IOException`

#### bind

    public void bind(java.net.SocketAddress ep,
            int bl)
              throws java.io.IOException

Overrides:
  `bind` in class `java.net.ServerSocket`
Throws:
  `java.io.IOException`

#### close

    public void close()
               throws java.io.IOException

Specified by:
  `close` in interface `java.io.Closeable`
Specified by:
  `close` in interface `java.lang.AutoCloseable`
Overrides:
  `close` in class `java.net.ServerSocket`
Throws:
  `java.io.IOException`

#### getChannel

    public java.nio.channels.ServerSocketChannel getChannel()

Overrides:
  `getChannel` in class `java.net.ServerSocket`

#### getInetAddress

    public java.net.InetAddress getInetAddress()

Overrides:
  `getInetAddress` in class `java.net.ServerSocket`

#### getLocalPort

    public int getLocalPort()

Overrides:
  `getLocalPort` in class `java.net.ServerSocket`

#### getLocalSocketAddress

    public java.net.SocketAddress getLocalSocketAddress()

Overrides:
  `getLocalSocketAddress` in class `java.net.ServerSocket`

#### getReceiveBufferSize

    public int getReceiveBufferSize()
                             throws java.net.SocketException

Overrides:
  `getReceiveBufferSize` in class `java.net.ServerSocket`
Throws:
  `java.net.SocketException`

#### getReuseAddress

    public boolean getReuseAddress()
                            throws java.net.SocketException

Overrides:
  `getReuseAddress` in class `java.net.ServerSocket`
Throws:
  `java.net.SocketException`

#### getSoTimeout

    public int getSoTimeout()
                     throws java.io.IOException

Overrides:
  `getSoTimeout` in class `java.net.ServerSocket`
Throws:
  `java.io.IOException`

#### isBound

    public boolean isBound()

Overrides:
  `isBound` in class `java.net.ServerSocket`

#### isClosed

    public boolean isClosed()

Overrides:
  `isClosed` in class `java.net.ServerSocket`

#### setReceiveBufferSize

    public void setReceiveBufferSize(int size)
                              throws java.net.SocketException

Overrides:
  `setReceiveBufferSize` in class `java.net.ServerSocket`
Throws:
  `java.net.SocketException`

#### setReuseAddress

    public void setReuseAddress(boolean on)
                         throws java.net.SocketException

Overrides:
  `setReuseAddress` in class `java.net.ServerSocket`
Throws:
  `java.net.SocketException`

#### setSoTimeout

    public void setSoTimeout(int timeout)
                      throws java.net.SocketException

Overrides:
  `setSoTimeout` in class `java.net.ServerSocket`
Throws:
  `java.net.SocketException`

#### toString

    public java.lang.String toString()

Overrides:
  `toString` in class `java.net.ServerSocket`