edu.vt.middleware.ldap.ssl
public abstract class AbstractTLSSocketFactory extends javax.net.ssl.SSLSocketFactory
TLSSocketFactory
.Modifier and Type | Field and Description |
---|---|
protected java.lang.String[] |
cipherSuites
Enabled cipher suites.
|
static java.lang.String |
DEFAULT_PROTOCOL
Default SSL protocol, value is "TLS".
|
protected javax.net.ssl.SSLSocketFactory |
factory
SSLSocketFactory used for creating SSL sockets.
|
protected javax.net.ssl.HostnameVerifier |
hostnameVerifier
Hostname verifier for this socket factory.
|
protected java.lang.String[] |
protocols
Enabled protocol versions.
|
Constructor and Description |
---|
AbstractTLSSocketFactory() |
Modifier and Type | Method and Description |
---|---|
java.net.Socket |
createSocket()
This creates an unconnected socket.
|
java.net.Socket |
createSocket(java.net.InetAddress host,
int port)
This creates a socket and connects it to the specified port number at the
specified address.
|
java.net.Socket |
createSocket(java.net.InetAddress address,
int port,
java.net.InetAddress localAddress,
int localPort)
This creates a socket and connect it to the specified port number at the
specified address.
|
java.net.Socket |
createSocket(java.net.Socket s,
java.lang.String host,
int port,
boolean autoClose)
This returns a socket layered over an existing socket connected to the
named host, at the given port.
|
java.net.Socket |
createSocket(java.lang.String host,
int port)
This creates a socket and connects it to the specified port number at the
specified address.
|
java.net.Socket |
createSocket(java.lang.String host,
int port,
java.net.InetAddress localHost,
int localPort)
This creates a socket and connect it to the specified port number at the
specified address.
|
java.lang.String[] |
getDefaultCipherSuites()
This returns the list of cipher suites which are enabled by default.
|
java.lang.String[] |
getEnabledCipherSuites()
This returns the names of the SSL cipher suites which are currently enabled
for use on sockets created by this factory.
|
java.lang.String[] |
getEnabledProtocols()
This returns the names of the protocol versions which are currently enabled
for use on sockets created by this factory.
|
javax.net.ssl.SSLSocketFactory |
getFactory()
This returns the underlying
SSLSocketFactory that this class
uses for creating SSL Sockets. |
javax.net.ssl.HostnameVerifier |
getHostnameVerifier()
Returns the hostname verifier to invoke when sockets are created.
|
java.lang.String[] |
getSupportedCipherSuites()
This returns the names of the cipher suites which could be enabled for use
on an SSL connection.
|
abstract void |
initialize()
Prepares this socket factory for use.
|
protected javax.net.ssl.SSLSocket |
initSSLSocket(javax.net.ssl.SSLSocket s)
Initializes the supplied socket for use.
|
void |
setEnabledCipherSuites(java.lang.String[] s)
Sets the cipher suites enabled for use on sockets created by this factory.
|
void |
setEnabledProtocols(java.lang.String[] s)
Sets the protocol versions enabled for use on sockets created by this
factory.
|
void |
setHostnameVerifier(javax.net.ssl.HostnameVerifier verifier)
Sets the hostname verifier to invoke when sockets are created.
|
public static final java.lang.String DEFAULT_PROTOCOL
protected javax.net.ssl.SSLSocketFactory factory
protected javax.net.ssl.HostnameVerifier hostnameVerifier
protected java.lang.String[] cipherSuites
protected java.lang.String[] protocols
public abstract void initialize() throws java.security.GeneralSecurityException
java.security.GeneralSecurityException
- if the factory cannot be initializedpublic javax.net.ssl.SSLSocketFactory getFactory()
SSLSocketFactory
that this class
uses for creating SSL Sockets.SSLSocketFactory
public javax.net.ssl.HostnameVerifier getHostnameVerifier()
public void setHostnameVerifier(javax.net.ssl.HostnameVerifier verifier)
verifier
- for SSL hostnamespublic java.lang.String[] getEnabledCipherSuites()
String[]
of cipher suitespublic void setEnabledCipherSuites(java.lang.String[] s)
SSLSocket.setEnabledCipherSuites(String[])
.s
- String[]
of cipher suitespublic java.lang.String[] getEnabledProtocols()
String[]
of protocolspublic void setEnabledProtocols(java.lang.String[] s)
SSLSocket.setEnabledProtocols(String[])
.s
- String[]
of cipher suitesprotected javax.net.ssl.SSLSocket initSSLSocket(javax.net.ssl.SSLSocket s) throws java.io.IOException
s
- SSLSocket
to initializeSSLSocket
java.io.IOException
- if an I/O error occurs when initializing the socketpublic java.net.Socket createSocket(java.net.Socket s, java.lang.String host, int port, boolean autoClose) throws java.io.IOException
createSocket
in class javax.net.ssl.SSLSocketFactory
s
- Socket
existing sockethost
- String
server hostnameport
- int
server portautoClose
- boolean
close the underlying socket when
this socket is closedSocket
- connected to the specified host and portjava.io.IOException
- if an I/O error occurs when creating the socketpublic java.net.Socket createSocket() throws java.io.IOException
createSocket
in class javax.net.SocketFactory
Socket
- unconnected socketjava.io.IOException
- if an I/O error occurs when creating the socketpublic java.net.Socket createSocket(java.net.InetAddress host, int port) throws java.io.IOException
createSocket
in class javax.net.SocketFactory
host
- InetAddress
server hostnameport
- int
server portSocket
- connected to the specified host and portjava.io.IOException
- if an I/O error occurs when creating the socketpublic java.net.Socket createSocket(java.net.InetAddress address, int port, java.net.InetAddress localAddress, int localPort) throws java.io.IOException
createSocket
in class javax.net.SocketFactory
address
- InetAddress
server hostnameport
- int
server portlocalAddress
- InetAddress
client hostnamelocalPort
- int
client portSocket
- connected to the specified host and portjava.io.IOException
- if an I/O error occurs when creating the socketpublic java.net.Socket createSocket(java.lang.String host, int port) throws java.io.IOException
createSocket
in class javax.net.SocketFactory
host
- String
server hostnameport
- int
server portSocket
- connected to the specified host and portjava.io.IOException
- if an I/O error occurs when creating the socketpublic java.net.Socket createSocket(java.lang.String host, int port, java.net.InetAddress localHost, int localPort) throws java.io.IOException
createSocket
in class javax.net.SocketFactory
host
- String
server hostnameport
- int
server portlocalHost
- InetAddress
client hostnamelocalPort
- int
client portSocket
- connected to the specified host and portjava.io.IOException
- if an I/O error occurs when creating the socketpublic java.lang.String[] getDefaultCipherSuites()
getDefaultCipherSuites
in class javax.net.ssl.SSLSocketFactory
String[]
- array of the cipher suitespublic java.lang.String[] getSupportedCipherSuites()
getSupportedCipherSuites
in class javax.net.ssl.SSLSocketFactory
String[]
- array of the cipher suitesCopyright © 2014. All Rights Reserved.