Top Description Fields Constructors Methods
org.hsqldb.server

public final Class HsqlSocketFactorySecure

extends HsqlSocketFactory
implements HandshakeCompletedListener
Class Inheritance
All Implemented Interfaces
javax.net.ssl.HandshakeCompletedListener, java.util.EventListener
Imports
java.net.InetAddress, .ServerSocket, .Socket, .UnknownHostException, java.security.Principal, java.security.cert.Certificate, .X509Certificate, javax.net.ssl.HandshakeCompletedEvent, .HandshakeCompletedListener, .SSLServerSocket, .SSLServerSocketFactory, .SSLSession, .SSLSocket, .SSLSocketFactory, org.hsqldb.error.Error, .ErrorCode, org.hsqldb.lib.StringConverter

The default secure socket factory implementation.
Authors
Campbell Burnet (campbell-burnet@users dot sourceforge.net), Blaine Simpson (blaine dot simpson at admc dot com)
Since
1.7.2
Version
2.6.0

Field Summary

Modifier and TypeField and Description
pack-priv final Object
server_socket_factory_mutex

Monitor object to guard against concurrent modification of the underlying server socket factory implementation member.

pack-priv Object
serverSocketFactory

The underlying server socket factory implementation.

pack-priv final Object
socket_factory_mutex

Monitor object to guard against concurrent modification of the underlying socket factory implementation member.

pack-priv Object
socketFactory

The underlying socket factory implementation.

Constructor Summary

AccessConstructor and Description
pack-priv
HsqlSocketFactorySecure()

External construction disabled.

Method Summary

Modifier and TypeMethod and Description
public void
public ServerSocket

Returns:

the secure ServerSocket
createServerSocket
(int
the port to which to bind the secure ServerSocket
port
)

Overrides org.hsqldb.server.HsqlSocketFactory.createServerSocket.

Creates a secure server socket bound to the specified port.

public ServerSocket

Returns:

the secure ServerSocket
createServerSocket
(int
the port to which to bind the secure ServerSocket
port
,
String address)

Overrides org.hsqldb.server.HsqlSocketFactory.createServerSocket.

Creates a secure server socket bound to the specified port.

public Socket

Returns:

the socket
createSocket
(Socket
the existing socket
socket
,
String
the server host
host
,
int
the server port
port
)

Overrides org.hsqldb.server.HsqlSocketFactory.createSocket.

if socket argument is not null, creates a secure Socket as a wrapper for the normal, non-SSL socket.

public Socket

Returns:

the socket
createSocket
(String
the server host
host
,
int
the server port
port
)

Overrides org.hsqldb.server.HsqlSocketFactory.createSocket.

Creates a secure Socket and connects it to the specified remote host at the specified remote port.

private static void
dump(String title, String[] as)

pack-priv SSLServerSocketFactory

Returns:

the underlying javax.net.ssl.SSLServerSocketFactory
getServerSocketFactoryImpl
()

Retrieves the underlying javax.net.ssl.SSLServerSocketFactory.

pack-priv SSLSocketFactory

Returns:

the underlying javax.net.ssl.SSLSocketFactory
getSocketFactoryImpl
()

Retrieves the underlying javax.net.ssl.SSLSocketFactory.

public void
handshakeCompleted(HandshakeCompletedEvent evt)

Implements javax.net.ssl.HandshakeCompletedListener.handshakeCompleted.

This method is invoked on registered objects when a SSL handshake is completed.

public boolean

Returns:

true iff this factory creates secure sockets
isSecure
()

Overrides org.hsqldb.server.HsqlSocketFactory.isSecure.

Retrieves whether this factory produces secure sockets.

pack-priv void
verify(String
the requested host name
host
,
SSLSession
SSLSession used on the connection to host
session
)

Verifies the certificate chain presented by the server to which a secure Socket has just connected.

Inherited from org.hsqldb.server.HsqlSocketFactory:
getInstance

Field Detail

server_socket_factory_mutexback to summary
pack-priv final Object server_socket_factory_mutex

Monitor object to guard against concurrent modification of the underlying server socket factory implementation member.

serverSocketFactoryback to summary
pack-priv Object serverSocketFactory

The underlying server socket factory implementation.

socket_factory_mutexback to summary
pack-priv final Object socket_factory_mutex

Monitor object to guard against concurrent modification of the underlying socket factory implementation member.

socketFactoryback to summary
pack-priv Object socketFactory

The underlying socket factory implementation.

Constructor Detail

HsqlSocketFactorySecureback to summary
pack-priv HsqlSocketFactorySecure()

External construction disabled. New factory instances are retrieved through the newHsqlSocketFactory method instead.

Method Detail

configureSocketback to summary
public void configureSocket(Socket socket)

Overrides org.hsqldb.server.HsqlSocketFactory.configureSocket.

createServerSocketback to summary
public ServerSocket createServerSocket(int port) throws Exception

Overrides org.hsqldb.server.HsqlSocketFactory.createServerSocket.

Creates a secure server socket bound to the specified port. The socket is configured with the socket options given to this factory.

Parameters
port:int

the port to which to bind the secure ServerSocket

Returns:ServerSocket

the secure ServerSocket

Exceptions
Exception:
if a network or security provider error occurs
createServerSocketback to summary
public ServerSocket createServerSocket(int port, String address) throws Exception

Overrides org.hsqldb.server.HsqlSocketFactory.createServerSocket.

Creates a secure server socket bound to the specified port. The socket is configured with the socket options given to this factory.

Parameters
port:int

the port to which to bind the secure ServerSocket

Returns:ServerSocket

the secure ServerSocket

Exceptions
Exception:
if a network or security provider error occurs
createSocketback to summary
public Socket createSocket(Socket socket, String host, int port) throws Exception

Overrides org.hsqldb.server.HsqlSocketFactory.createSocket.

if socket argument is not null, creates a secure Socket as a wrapper for the normal, non-SSL socket. If the socket is null, create a new secure socket. The secure socket is configured using the socket options established for this factory.

Parameters
socket:Socket

the existing socket

host:String

the server host

port:int

the server port

Returns:Socket

the socket

Exceptions
Exception:
if a network or security provider error occurs
createSocketback to summary
public Socket createSocket(String host, int port) throws Exception

Overrides org.hsqldb.server.HsqlSocketFactory.createSocket.

Creates a secure Socket and connects it to the specified remote host at the specified remote port. This socket is configured using the socket options established for this factory.

Parameters
host:String

the server host

port:int

the server port

Returns:Socket

the socket

Exceptions
Exception:
if a network or security provider error occurs
dumpback to summary
private static void dump(String title, String[] as)
getServerSocketFactoryImplback to summary
pack-priv SSLServerSocketFactory getServerSocketFactoryImpl()

Retrieves the underlying javax.net.ssl.SSLServerSocketFactory.

Returns:SSLServerSocketFactory

the underlying javax.net.ssl.SSLServerSocketFactory

getSocketFactoryImplback to summary
pack-priv SSLSocketFactory getSocketFactoryImpl()

Retrieves the underlying javax.net.ssl.SSLSocketFactory.

Returns:SSLSocketFactory

the underlying javax.net.ssl.SSLSocketFactory

handshakeCompletedback to summary
public void handshakeCompleted(HandshakeCompletedEvent evt)

Implements javax.net.ssl.HandshakeCompletedListener.handshakeCompleted.

Doc from javax.net.ssl.HandshakeCompletedListener.handshakeCompleted.

This method is invoked on registered objects when a SSL handshake is completed.

isSecureback to summary
public boolean isSecure()

Overrides org.hsqldb.server.HsqlSocketFactory.isSecure.

Retrieves whether this factory produces secure sockets.

Returns:boolean

true iff this factory creates secure sockets

verifyback to summary
pack-priv void verify(String host, SSLSession session) throws Exception

Verifies the certificate chain presented by the server to which a secure Socket has just connected. Specifically, the provided host name is checked against the Common Name of the server certificate; additional checks may or may not be performed.

Parameters
host:String

the requested host name

session:SSLSession

SSLSession used on the connection to host

Exceptions
Exception:
if the certificate chain cannot be verified