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.
@author
Tom Elrod