|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.remoting.security.SSLSocketBuilder
public class SSLSocketBuilder
This builds SSL server socket factories and SSL socket factories.
The main methods are createSSLServerSocketFactory() and createSSLSocketFactory(). By default, these methods will use SSLServerSocketFactory.getDefault() and SSLSocketFactory.getDefault() and will require the proper system properties to be set. To use a custom configuration, will need to set either the useSSLServerSocketFactory or useSSLSocketFactory properties to be false. Some common errors seen are: 1. javax.net.ssl.SSLException: No available certificate corresponds to the SSL cipher suites which are enabled The 'javax.net.ssl.keyStore' system property has not been set and are using the default SSLServerSocketFactory. 2. java.net.SocketException: Default SSL context init failed: Cannot recover key The 'javax.net.ssl.keyStorePassword' system property has not been set and are using the default SSLServerSocketFactory. 3. java.io.IOException: Can not create SSL Server Socket Factory due to the url to the key store not being set. The default SSLServerSocketFactory is NOT being used (so custom configuration for the server socket factory) and the key store url has not been set. 4. java.lang.IllegalArgumentException: password can't be null The default SSLServerSocketFactory is NOT being used (so custom configuration for the server socket factory) and the key store password has not been set.
| Field Summary | |
|---|---|
static java.lang.String |
DEFAULT_KEY_MANAGEMENT_ALGORITHM
Value is SunX509. |
static java.lang.String |
DEFAULT_KEY_STORE_TYPE
Value is JKS |
static java.lang.String |
DEFAULT_SECURE_SOCKET_PROTOCOL
Value is TLS (Transport Layer Security). |
| Constructor Summary | |
|---|---|
SSLSocketBuilder()
|
|
| Method Summary | |
|---|---|
void |
create()
create the service, do expensive operations etc |
javax.net.ServerSocketFactory |
createSSLServerSocketFactory()
Will create a SSLServerSocketFactory. |
javax.net.SocketFactory |
createSSLSocketFactory()
Will create a SSLSocketFactory. |
void |
destroy()
destroy the service, tear down |
java.lang.String |
getKeyManagementAlgorithm()
The algorithm for the key manager factory. |
java.lang.String |
getKeyStoreType()
The type to be used for the key store. |
java.lang.String |
getSecureSocketProtocol()
The protocol for the SSLContext. |
boolean |
getUseSSLServerSocketFactory()
Return whether SSLServerSocketFactory.getDefault() will be used or not. |
boolean |
getUseSSLSocketFactory()
Return whether SSLSocketFactory.getDefault() will be used or not. |
void |
setKeyManagementAlgorithm(java.lang.String keyManagementAlgorithm)
The algorithm for the key manager factory. |
void |
setKeyPassword(java.lang.String passphrase)
Sets the password to use for the keys within the key store. |
void |
setKeyStorePassword(java.lang.String passphrase)
Sets the password to use for the key store. |
void |
setKeyStoreType(java.lang.String keyStoreType)
The type to be used for the key store. |
void |
setKeyStoreURL(java.lang.String storeURL)
This is the url string to the key store to use. |
void |
setSecureSocketProtocol(java.lang.String secureSocketProtocol)
The protocol for the SSLContext. |
void |
setTrustStoreURL(java.lang.String storeURL)
This is the url string to the trust store to use. |
void |
setUseClientMode(boolean useClientMode)
Determines whether factories returned by SSLSocketBuilder create Sockets/ServerSockets in client or server mode. |
void |
setUseSSLServerSocketFactory(boolean shouldUse)
Will indicate if should use the SSLServerSocketFactory.getDefault() for getting the ServerSocketFactory to use (when calling createSSLServerSocketFactory()). |
void |
setUseSSLSocketFactory(boolean shouldUse)
Will indicate if should use the SSLSocketFactory.getDefault() for getting the SocketFactory to use (when calling createSSLSocketFactory()). |
void |
start()
start the service, create is already called |
void |
stop()
stop the service |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String DEFAULT_SECURE_SOCKET_PROTOCOL
public static final java.lang.String DEFAULT_KEY_MANAGEMENT_ALGORITHM
public static final java.lang.String DEFAULT_KEY_STORE_TYPE
| Constructor Detail |
|---|
public SSLSocketBuilder()
| Method Detail |
|---|
public void setUseSSLServerSocketFactory(boolean shouldUse)
setUseSSLServerSocketFactory in interface SSLSocketBuilderMBeanshouldUse - public boolean getUseSSLServerSocketFactory()
getUseSSLServerSocketFactory in interface SSLSocketBuilderMBeanpublic void setUseSSLSocketFactory(boolean shouldUse)
setUseSSLSocketFactory in interface SSLSocketBuilderMBeanshouldUse - public boolean getUseSSLSocketFactory()
getUseSSLSocketFactory in interface SSLSocketBuilderMBeanpublic java.lang.String getSecureSocketProtocol()
getSecureSocketProtocol in interface SSLSocketBuilderMBeanpublic void setSecureSocketProtocol(java.lang.String secureSocketProtocol)
setSecureSocketProtocol in interface SSLSocketBuilderMBeanpublic java.lang.String getKeyManagementAlgorithm()
getKeyManagementAlgorithm in interface SSLSocketBuilderMBeanpublic void setKeyManagementAlgorithm(java.lang.String keyManagementAlgorithm)
setKeyManagementAlgorithm in interface SSLSocketBuilderMBeanpublic java.lang.String getKeyStoreType()
getKeyStoreType in interface SSLSocketBuilderMBeanpublic void setKeyStoreType(java.lang.String keyStoreType)
setKeyStoreType in interface SSLSocketBuilderMBeanpublic void setKeyStorePassword(java.lang.String passphrase)
setKeyStorePassword in interface SSLSocketBuilderMBeanpassphrase - public void setKeyPassword(java.lang.String passphrase)
setKeyPassword in interface SSLSocketBuilderMBeanpassphrase - public void setUseClientMode(boolean useClientMode)
useClientMode -
public javax.net.ServerSocketFactory createSSLServerSocketFactory()
throws java.io.IOException,
java.security.NoSuchAlgorithmException,
java.security.KeyStoreException,
java.security.cert.CertificateException,
java.security.UnrecoverableKeyException,
java.security.KeyManagementException
createSSLServerSocketFactory in interface SSLSocketBuilderMBeanjava.io.IOException
java.security.NoSuchAlgorithmException
java.security.KeyStoreException
java.security.cert.CertificateException
java.security.UnrecoverableKeyException
java.security.KeyManagementException
public javax.net.SocketFactory createSSLSocketFactory()
throws java.io.IOException,
java.security.NoSuchAlgorithmException,
java.security.KeyStoreException,
java.security.cert.CertificateException,
java.security.KeyManagementException
createSSLSocketFactory in interface SSLSocketBuilderMBeanjava.io.IOException
java.security.NoSuchAlgorithmException
java.security.KeyStoreException
java.security.cert.CertificateException
java.security.KeyManagementException
public void setKeyStoreURL(java.lang.String storeURL)
throws java.io.IOException
setKeyStoreURL in interface SSLSocketBuilderMBeanstoreURL -
java.io.IOException
public void setTrustStoreURL(java.lang.String storeURL)
throws java.io.IOException
setTrustStoreURL in interface SSLSocketBuilderMBeanstoreURL -
java.io.IOException
public void create()
throws java.lang.Exception
create in interface SSLSocketBuilderMBeanjava.lang.Exception
public void start()
throws java.lang.Exception
start in interface SSLSocketBuilderMBeanjava.lang.Exceptionpublic void stop()
stop in interface SSLSocketBuilderMBeanpublic void destroy()
destroy in interface SSLSocketBuilderMBean
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||