net.sourceforge.jtds.ssl

Class SocketFactories.TdsTlsSocketFactory

Enclosing Class:
SocketFactories

private static class SocketFactories.TdsTlsSocketFactory
extends SocketFactory

The socket factory for creating sockets based on the SSL setting.

Field Summary

private static SSLSocketFactory
factorySingleton
private Socket
socket
private String
ssl

Constructor Summary

TdsTlsSocketFactory(String ssl, Socket socket)
Constructs a TdsTlsSocketFactory.

Method Summary

Socket
createSocket(InetAddress host, int port)
Socket
createSocket(InetAddress host, int port, InetAddress localHost, int localPort)
Socket
createSocket(String host, int port)
Create the SSL socket.
Socket
createSocket(String host, int port, InetAddress localHost, int localPort)
private static SSLSocketFactory
factory()
Returns an SSLSocketFactory whose sockets will not authenticate the server.
private SSLSocketFactory
getFactory()
Returns an SSLSocketFactory whose behavior will depend on the SSL setting.
private static TrustManager[]
trustManagers()

Field Details

factorySingleton

private static SSLSocketFactory factorySingleton

socket

private final Socket socket

ssl

private final String ssl

Constructor Details

TdsTlsSocketFactory

public TdsTlsSocketFactory(String ssl,
                           Socket socket)
Constructs a TdsTlsSocketFactory.
Parameters:
ssl - the SSL setting
socket - the TCP/IP socket to wrap

Method Details

createSocket

public Socket createSocket(InetAddress host,
                           int port)
            throws IOException

createSocket

public Socket createSocket(InetAddress host,
                           int port,
                           InetAddress localHost,
                           int localPort)
            throws IOException

createSocket

public Socket createSocket(String host,
                           int port)
            throws IOException,
                   UnknownHostException
Create the SSL socket.

NB. This method will actually create a connected socket over the TCP/IP network socket supplied via the constructor of this factory class.


createSocket

public Socket createSocket(String host,
                           int port,
                           InetAddress localHost,
                           int localPort)
            throws IOException,
                   UnknownHostException

factory

private static SSLSocketFactory factory()
            throws NoSuchAlgorithmException,
                   KeyManagementException
Returns an SSLSocketFactory whose sockets will not authenticate the server.
Returns:
an SSLSocketFactory

getFactory

private SSLSocketFactory getFactory()
            throws IOException
Returns an SSLSocketFactory whose behavior will depend on the SSL setting.
Returns:
an SSLSocketFactory

trustManagers

private static TrustManager[] trustManagers()

Generated on September 18 2009