Package net.sourceforge.jtds.ssl
Class SocketFactories.TdsTlsSocketFactory
java.lang.Object
javax.net.SocketFactory
net.sourceforge.jtds.ssl.SocketFactories.TdsTlsSocketFactory
- Enclosing class:
SocketFactories
The socket factory for creating sockets based on the SSL setting.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static SSLSocketFactoryprivate final Socketprivate final String -
Constructor Summary
ConstructorsConstructorDescriptionTdsTlsSocketFactory(String ssl, Socket socket) Constructs a TdsTlsSocketFactory. -
Method Summary
Modifier and TypeMethodDescriptioncreateSocket(String host, int port) Create the SSL socket.createSocket(String host, int port, InetAddress localHost, int localPort) createSocket(InetAddress host, int port) createSocket(InetAddress host, int port, InetAddress localHost, int localPort) private static SSLSocketFactoryfactory()Returns an SSLSocketFactory whose sockets will not authenticate the server.private SSLSocketFactoryReturns an SSLSocketFactory whose behavior will depend on the SSL setting.private static TrustManager[]Methods inherited from class javax.net.SocketFactory
createSocket, getDefault
-
Field Details
-
factorySingleton
-
ssl
-
socket
-
-
Constructor Details
-
TdsTlsSocketFactory
Constructs a TdsTlsSocketFactory.- Parameters:
ssl- the SSL settingsocket- the TCP/IP socket to wrap
-
-
Method Details
-
createSocket
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.- Specified by:
createSocketin classSocketFactory- Throws:
IOExceptionUnknownHostException
-
createSocket
- Specified by:
createSocketin classSocketFactory- Throws:
IOException
-
createSocket
public Socket createSocket(String host, int port, InetAddress localHost, int localPort) throws IOException, UnknownHostException - Specified by:
createSocketin classSocketFactory- Throws:
IOExceptionUnknownHostException
-
createSocket
public Socket createSocket(InetAddress host, int port, InetAddress localHost, int localPort) throws IOException - Specified by:
createSocketin classSocketFactory- Throws:
IOException
-
getFactory
Returns an SSLSocketFactory whose behavior will depend on the SSL setting.- Returns:
- an
SSLSocketFactory - Throws:
IOException
-
factory
Returns an SSLSocketFactory whose sockets will not authenticate the server.- Returns:
- an
SSLSocketFactory - Throws:
NoSuchAlgorithmExceptionKeyManagementException
-
trustManagers
-