|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.net.SocketFactory
javax.net.ssl.SSLSocketFactory
com.sun.slamd.example.JSSEBlindTrustSocketFactory
public class JSSEBlindTrustSocketFactory
This class provides an implementation of an SSL socket factory that will use JSSE to create the SSL socket. In addition, it will implement a trust mechanism in such a way that it will blindly trust any certificate that the server presents to it, regardless of what we might think is wrong with it.
| Constructor Summary | |
|---|---|
JSSEBlindTrustSocketFactory()
Creates a new instance of this LDAP socket factory. |
|
JSSEBlindTrustSocketFactory(boolean debugMode)
Creates a new instance of this LDAP socket factory, optionally operating in debug mode. |
|
| Method Summary | |
|---|---|
void |
checkClientTrusted(java.security.cert.X509Certificate[] chain,
java.lang.String authType)
Determines whether the provided client certificate should be trusted. |
void |
checkServerTrusted(java.security.cert.X509Certificate[] chain,
java.lang.String authType)
Determines whether the provided server certificate should be trusted. |
java.net.Socket |
createSocket(java.net.InetAddress host,
int port)
Creates a new SSL socket connected to the specified host and port. |
java.net.Socket |
createSocket(java.net.InetAddress host,
int port,
java.net.InetAddress localAddress,
int localPort)
Creates a new SSL socket connected to the specified host and port. |
java.net.Socket |
createSocket(java.net.Socket socket,
java.lang.String host,
int port,
boolean autoClose)
Converts the provided socket to an SSL socket using this socket factory. |
java.net.Socket |
createSocket(java.lang.String host,
int port)
Creates a new SSL socket connected to the specified host and port. |
java.net.Socket |
createSocket(java.lang.String host,
int port,
java.net.InetAddress localHost,
int localPort)
Creates a new SSL socket connected to the specified host and port. |
java.security.cert.X509Certificate[] |
getAcceptedIssuers()
Retrieves an array of CA certificates that are trusted for authenticating peers. |
java.lang.String[] |
getCiphers()
Retrieves the names of the ciphers that should be used for SSL sockets created by this socket factory. |
java.lang.String[] |
getDefaultCipherSuites()
Retrieves the set of cipher suites that are enabled by default. |
boolean |
getDisableSessionReuse()
Indicates whether SSL sessions may be reused across multiple connections. |
java.lang.String[] |
getSupportedCipherSuites()
Retrieves the set of cipher suites that can be used to create SSL sockets. |
java.net.Socket |
makeSocket(java.lang.String host,
int port)
Establishes an SSL socket to the provided host and port that can be used by the LDAP SDK for Java for communicating with an LDAP directory server. |
void |
setCipher(java.lang.String cipherName)
Specifies the name of the cipher that should be used for SSL sockets created by this socket factory. |
void |
setCiphers(java.lang.String[] cipherNames)
Specifies the names of the cipher that should be used for SSL sockets created by this socket factory. |
void |
setDisableSessionReuse(boolean disableSessionReuse)
Specifies whether to disable SSL session reuse across multiple connections. |
| Methods inherited from class javax.net.ssl.SSLSocketFactory |
|---|
getDefault |
| Methods inherited from class javax.net.SocketFactory |
|---|
createSocket |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JSSEBlindTrustSocketFactory()
throws netscape.ldap.LDAPException
netscape.ldap.LDAPException - If a problem occurs while initializing this socket
factory.
public JSSEBlindTrustSocketFactory(boolean debugMode)
throws netscape.ldap.LDAPException
debugMode - Indicates whether to operate in debug mode. If this is
enabled, a message will be printed to standard error
any time of of the methods of this class is called.
netscape.ldap.LDAPException - If a problem occurs while initializing this socket
factory.| Method Detail |
|---|
public void checkClientTrusted(java.security.cert.X509Certificate[] chain,
java.lang.String authType)
checkClientTrusted in interface javax.net.ssl.X509TrustManagerchain - The peer certificate chain.authType - The authentication type based on the client certificate.
public void checkServerTrusted(java.security.cert.X509Certificate[] chain,
java.lang.String authType)
checkServerTrusted in interface javax.net.ssl.X509TrustManagerchain - The peer certificate chain.authType - The authentication type based on the server certificate.public java.security.cert.X509Certificate[] getAcceptedIssuers()
getAcceptedIssuers in interface javax.net.ssl.X509TrustManager
public java.net.Socket makeSocket(java.lang.String host,
int port)
throws netscape.ldap.LDAPException
makeSocket in interface netscape.ldap.LDAPSocketFactoryhost - The address of the server to which the connection is to be
established.port - The port number of the server to which the connection is to
be established.
netscape.ldap.LDAPException - If a problem occurs while trying to establish the
connection.
public java.net.Socket createSocket(java.lang.String host,
int port)
throws java.io.IOException
createSocket in class javax.net.SocketFactoryhost - The address of the system to which the SSL socket should be
connected.port - The port on the target system to which the SSL socket should
be connected.
java.io.IOException - If a problem occurs while creating the SSL socket.
public 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.SocketFactoryhost - The address of the system to which the SSL socket should
be connected.port - The port on the target system to which the SSL socket
should be connected.localHost - The address on the local system from which the socket
should originate.localPort - The port on the local system from which the socket
should originate.
java.io.IOException - If a problem occurs while creating the SSL socket.
public java.net.Socket createSocket(java.net.InetAddress host,
int port)
throws java.io.IOException
createSocket in class javax.net.SocketFactoryhost - The address of the system to which the SSL socket should be
connected.port - The port on the target system to which the SSL socket should
be connected.
java.io.IOException - If a problem occurs while creating the SSL socket.
public java.net.Socket createSocket(java.net.InetAddress host,
int port,
java.net.InetAddress localAddress,
int localPort)
throws java.io.IOException
createSocket in class javax.net.SocketFactoryhost - The address of the system to which the SSL socket
should be connected.port - The port on the target system to which the SSL socket
should be connected.localAddress - The address on the local system from which the socket
should originate.localPort - The port on the local system from which the socket
should originate.
java.io.IOException - If a problem occurs while creating the SSL socket.
public java.net.Socket createSocket(java.net.Socket socket,
java.lang.String host,
int port,
boolean autoClose)
throws java.io.IOException
createSocket in class javax.net.ssl.SSLSocketFactorysocket - The socket to convert to an SSL socket.host - The host to which the socket is connected.port - The port to which the socket is connected.autoClose - Indicates whether the underlying socket should be closed
when the returned SSL socket is closed.
java.io.IOException - If a problem occurs while creating the SSL socket.public java.lang.String[] getCiphers()
public void setCipher(java.lang.String cipherName)
cipherName - The name of the cipher that should be used for SSL
sockets created by this socket factory.public void setCiphers(java.lang.String[] cipherNames)
cipherNames - The names of the cipher that should be used for SSL
sockets created by this socket factory.public java.lang.String[] getDefaultCipherSuites()
getDefaultCipherSuites in class javax.net.ssl.SSLSocketFactorypublic java.lang.String[] getSupportedCipherSuites()
getSupportedCipherSuites in class javax.net.ssl.SSLSocketFactorypublic boolean getDisableSessionReuse()
true if SSL sessions may be reused across multiple
connections, or false if not.public void setDisableSessionReuse(boolean disableSessionReuse)
disableSessionReuse - Indicates whether to disable SSL session
reuse across multiple connections.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||