SK.gnome.dwarf.tcpip
Class SSLListener

java.lang.Object
  extended bySK.gnome.dwarf.GenericService
      extended bySK.gnome.dwarf.thread.ThreadService
          extended bySK.gnome.dwarf.tcpip.Listener
              extended bySK.gnome.dwarf.tcpip.TCPListener
                  extended bySK.gnome.dwarf.tcpip.SSLListener
All Implemented Interfaces:
java.lang.Runnable, Service

public class SSLListener
extends TCPListener

Service for receiving SSL/TLS client connections.

The SSL server socket is obtained from the parent TCPIPServer instance. See the getServerSocket() for more information.


Field Summary
protected  java.lang.String[] enabledCipherSuites
          Enabled sipher suites.
protected  boolean enableSessionCreation
          Whether to enable the session creation.
protected  boolean needClientAuth
          Whether the client authentication is needed.
protected  boolean useClientMode
          Whether the client mode is enabled.
 
Fields inherited from class SK.gnome.dwarf.tcpip.TCPListener
backlog, socket
 
Fields inherited from class SK.gnome.dwarf.tcpip.Listener
address, allowedHosts, deniedHosts, port
 
Fields inherited from class SK.gnome.dwarf.thread.ThreadService
daemon, thread
 
Fields inherited from class SK.gnome.dwarf.GenericService
initParameters, parent
 
Fields inherited from interface SK.gnome.dwarf.Service
INITIALIZED, LOG_DEBUG, LOG_ERROR, LOG_FATAL, LOG_INFO, LOG_TRACE, LOG_WARN, LOG_XFER, SHUTDOWN, STARTED, STOPPED
 
Constructor Summary
SSLListener(java.lang.String name)
          Creates a new SSLListener.
 
Method Summary
protected  java.net.ServerSocket getServerSocket()
          Returns the SSL server socket.
 void init(Server parent)
          Initializes the service.
 void setEnabledCipherSuites(java.lang.String[] suites)
          Sets the enabled cipher suites.
 void setEnableSessionCreation(boolean enable)
          Enables or disables the SSL session creation.
 void setNeedClientAuth(boolean enable)
          Enables or disables the client authentication.
 void setUseClientMode(boolean enable)
          Enables or disables the client mode.
 
Methods inherited from class SK.gnome.dwarf.tcpip.TCPListener
enableThread, finish, loop, setBacklog, setDumpDir
 
Methods inherited from class SK.gnome.dwarf.tcpip.Listener
acceptHost, setAddress, setAllowedHosts, setDeniedHosts, setPort
 
Methods inherited from class SK.gnome.dwarf.thread.ThreadService
run, setDaemon, shutdown, start, stop
 
Methods inherited from class SK.gnome.dwarf.GenericService
getAuthenticator, getAuthFacility, getFullName, getInitParameter, getInitParameterNames, getLogFacility, getLogger, getName, getParameters, getPrincipal, getShutdownTimeout, getState, log, log, login, logout, setAuthFacility, setInitParameters, setLogFacility, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

enabledCipherSuites

protected java.lang.String[] enabledCipherSuites
Enabled sipher suites.

Default value: null, i.e. all suites are enabled

See Also:
setEnabledCipherSuites(String[])

enableSessionCreation

protected boolean enableSessionCreation
Whether to enable the session creation.

Default value: true

See Also:
setEnableSessionCreation(boolean)

needClientAuth

protected boolean needClientAuth
Whether the client authentication is needed.

Default value: false

See Also:
setNeedClientAuth(boolean)

useClientMode

protected boolean useClientMode
Whether the client mode is enabled.

Default value: false

See Also:
setUseClientMode(boolean)
Constructor Detail

SSLListener

public SSLListener(java.lang.String name)
Creates a new SSLListener.

Method Detail

setEnabledCipherSuites

public void setEnabledCipherSuites(java.lang.String[] suites)
Sets the enabled cipher suites.

By default all available cipher suites are enabled.

Parameters:
suites - the comma separated list of cipher suite names

setEnableSessionCreation

public void setEnableSessionCreation(boolean enable)
Enables or disables the SSL session creation.

By default the session creation is enabled.

Parameters:
enable - true to the session creation

setNeedClientAuth

public void setNeedClientAuth(boolean enable)
Enables or disables the client authentication.

By default the client authentication is not required.

Parameters:
enable - true to require the client authentication

setUseClientMode

public void setUseClientMode(boolean enable)
Enables or disables the client mode.

By default the client mode is not enabled.

Parameters:
enable - true to enable the client mode

init

public void init(Server parent)
          throws ServiceException
Description copied from class: TCPListener
Initializes the service.

Sets the TCPListener.socket field to value returned by the TCPListener.getServerSocket() method.

This method requires that the parent server is an instance of TCPIPServer class.

Specified by:
init in interface Service
Overrides:
init in class TCPListener
Throws:
ServiceException

getServerSocket

protected java.net.ServerSocket getServerSocket()
                                         throws ServiceException
Returns the SSL server socket.

This method calls the parent server's TCPIPServer.createSSLServerSocket(int, int, java.net.InetAddress) method and simply returns its result.

Overrides:
getServerSocket in class TCPListener
Throws:
ServiceException


Copyright (c) 1999-2005, Gnome Ltd. All rights reserved.