Enabling SSL communication in Liberty
To enable SSL communication in Liberty, there is a minimal set of SSL configuration options. It assumes most of the SSL options require some keystore configuration information.
About this task
SSL client authentication occurs during the connection handshake by using SSL certificates. The
SSL handshake is a series of messages that are exchanged over the SSL protocol to negotiate for
connection-specific protection. During the handshake, the secure server requests that the client
send back a certificate or certificate chain for the authentication. To enable SSL in Liberty, you add the
Liberty feature to the configuration root
document file, server.xml, along with code of the keystore information for
By default, the path and file name for the configuration root document file is path_to_liberty/wlp/usr/servers/server_name/server.xml. path_to_liberty is the location that you installed Liberty on your operating system, and server_name is the name of your server. However, you can change the path. See Customizing the Liberty environment.
transportSecurity-1.0Liberty feature in the server.xml file.
<featureManager> <feature>transportSecurity-1.0</feature> </featureManager>
transportSecurity-1.0feature is enabled, the Liberty server sets a custom SSL Socket factory that uses the
ssl.SocketFactory.providerJava security property. This security property is automatically set when the
transportSecurity-1.0feature is enabled. When you are using the
transportSecurity-1.0feature, the process
SSLContextis the SSLContext of the Java Secure Socket Extension (JSSE). A call to
SSLContext.getDefault()returns the default context
SSLContextof the JSSE. A call to
SSLSocketFactory.getDefault()returns an SSLSocketFactory that is based on the Liberty server custom socket factory provider that uses the Liberty SSLContext.
outboundSSLRefattribute and the
outboundConnectionelement are used for outbound SSL connections only if the
transportSecurity-1.0feature is specified. If the
transportSecurity-1.0feature is not specified, then the
outboundSSLRefattribute and the
outboundConnectionelement are ignored.Alternatively, SSL communication can be enabled by adding the
ssl-1.0Liberty feature in the server.xml file.
<featureManager> <feature>ssl-1.0</feature> </featureManager>Note: The
ssl-1.0feature does not enable SSL redirects. If application security is required and security information is redirected to a secure port, you must add the
Liberty feature to the server.xml file. The
appSecurityfeature enables the
ssl-1.0feature. It is not necessary to add both features. However, the
appSecurityfeature does not enable the
transportSecurity-1.0feature. If you need both
transportSecurity-1.0, you must add them separately.
ssl-1.0feature is enabled, the Liberty server creates an SSLContext from the default SSL configuration and makes that SSLContext the server default by calling the
SSLContext.setDefault()java API. This makes the default SSLContext of the Liberty server the process default SSLContext. If anything makes the
SSLContext.getDefault()Java™ API call, then the method returns Liberty SSLContext. The same applies to the
SSLSocketFactory.getDefault()Java™ API, in that the default socket factory from the default SSLContext is returned.
transportSecurity-1.0feature supersedes the
ssl-1.0feature and adds functionality that is not included with the
ssl-1.0feature. You can specify an SSL configuration to be used as the outbound as well as setup filters on an SSL configuration so that the SSL configuration can be used for an outbound SSL call based on a destination host and port. For more information about outbound SSL options, see Configuring SSL Settings for outbound communications and Outbound filters for SSL configurations.Note: Due to the nature of the JDK, if you are changing from the
transportSecurity-1.0feature to the
ssl-1.0feature or from the
ssl-1.0feature to the
transportSecurity-1.0feature, the Liberty server must be restarted to use the feature to its complete functionality.
Add the keystore service object entry to the server.xml file. The
keyStoreelement is called
defaultKeyStoreand contains the keystore password. The password can be entered in clear text or encoded. The securityUtility encode option can be used to encode the password.
<keyStore id="defaultKeyStore" password="yourPassword" />
The Liberty server creates a keystore password during profile creation and puts it in the server.env file that is in the server's home directory. If there is no keystore element for the defaultKeyStore file, this password is used to create a keystore file. This keystore file is then used as the defaultKeyStore file. Likewise, if a defaultKeyStore entry exists without a password in the sever.xml file when the server starts, the password from the server.env file is used to open the file. If you don't want to use the Liberty-generated keystore password, remove theAn example of a SAF key ring in the minimal configuration:
keystore_passwordentry from the server.env file. If a default keystore was already generated with the password from the server.env file, you might need to remove it.
<keyStore id="defaultKeyStore" location="safkeyring:///WASKeyring" type="JCERACFKS" password="password" fileBased="false" readOnly="true" />
RACF® key ring needs to be set up before you configure them for use by the Liberty server. The server does not create certificates and add them to RACF.The safkeyring URL is in the form:
where the racfid is the RACF user ID with read authority to the key ring named, WASKeyring.
safkeyring://racfid/WASKeyringThe single keystore entry for a minimal SSL configuration can be extended to include the location and type as well.
<keyStore id="defaultKeyStore" location="myKeyStore.p12" password="yourPassword" type="PKCS12"/>
This configuration is the minimum that is needed to create an SSL configuration. In this configuration, the server creates the keystore and certificate if it does not exist during SSL initialization. The password that is provided must be at least 6 characters long.
The keystore is assumed to be a PKCS12 keystore that is called key.p12 in the server home/resources/security directory.
Through 188.8.131.52, the keystore is assumed to be a JKS keystore that is called key.jks in the server home/resources/security directory.
If the file does not exist the server creates it for you. If the server creates the keystore file, it also creates the certificate inside of it. The certificate is a self-signed certificate with a validity period of 365 days, the CN value of the certificate's subjectDN is the host name of the machine where the server is running, and has a signature algorithm of SHA256withRSA.Note: When the use of a collective controller is not practical, perhaps there is only one or two Liberty servers, a self-signed certificate can be used to restrict the number of clients that can connect to the Liberty member server. It is suggested that an IHS server is used in front of the Liberty servers, where an appropriate CA signed certificate can be used, along with CN whitelisting, to control which clients can connect to IHS. A trusted channel between IHS and the Liberty Member server can be maintained by using the self-signed certificate.