]>
Use the following procedure to configure an SSL certificate for the Server Automation REST API.
If necessary, review the OpenSSL documentation at http://www.openssl.org for information about OpenSSL commands and options.
Procedure
$> openssl req -nodes -newkey rsa:4096 -keyout <hostname>.key -out <hostname>.csr -sha512 -subj '/C=<country>/ST=<state>/L=<location>/O=<organization>/OU=<unit>/CN=<hostname>/subjectAltName=DNS.1=<hostname(not fully qualified)>'
Example: to create a request for host 'serverA.acme.com' for an organization called ACME Inc:
$> openssl req -nodes -newkey rsa:4096 -keyout serverA.key -out serverA.csr -sha512 -subj '/C=US/ST=CA/L=Los Angeles/O=ACME Inc./OU=IT Dept./CN=serverA.acme.com/subjectAltName=DNS.1=serverA'
Check the contents of the certificate using a command such as:
$> openssl x509 -in <certificate_file> -text -noout
Example:
$> openssl x509 -in serverA_signed.crt -text -noout
A new password (e.g. "changeit") is required when prompted:
$> openssl pkcs12 -export -in <signed_cert_file> -inkey <hostname>.key -out <hostname>.p12 -name default -CAfile <CA_cert_file>
Example:
$> openssl pkcs12 -export -in serverA_signed.crt -inkey serverA.key -out serverA.p12 -name default -CAfile acme_ca.crt
$> Enter Export Password: changeit
$> Verifying - Enter Export Password: changeit
$> cd C:\WASLiberty\wlp\usr\servers\defaultServer\resources\security
$> move key.jks key.jks.orig
$> keytool -importkeystore -deststorepass <new_keystore_password> -destkeypass <new_key_password> -destkeystore key.jks -srckeystore <full_path_to_<hostname>.p12> -srcstoretype PKCS12 -srcstorepass <pass_used_in_p12_keystore> -alias default
Example (assuming serverA.p12 is located in C:\certs\):
$> "C:\WASLiberty\wlp\service\ibm-java-jre-8011-win-i386\jre\bin\keytool.exe" -importkeystore -deststorepass changeit -destkeypass changeit -destkeystore key.jks -srckeystore C:\certs\serverA.p12 -srcstoretype PKCS12 -srcstorepass changeit -alias default
Note: use the keytool.exe file that comes bundled with the Server Automation REST API for this, as shown in the example. The default location is: C:\WASLiberty\wlp\service\ibm-java-jre-8011-win-i386\jre\bin\keytool.exe
$> keytool -list -v -keystore key.jks
Example:
$> "C:\WASLiberty\wlp\service\ibm-java-jre-8011-win-i386\jre\bin\keytool.exe" -list -v -keystore key.jks
Enter keystore password: changeit
Keystore type: jks
Keystore provider: IBMJCE
Your keystore contains 1 entry
Alias name: default
...
...
<!--+
| SECURITY CONFIGURATIONS
+-->
<sslDefault sslRef="defaultSSLSettings"/>
<keyStore id="defaultKeyStore" password="changeit"/>
<ssl id="defaultSSLSettings" keyStoreRef="defaultKeyStore" sslProtocol="TLSv1.2"/>
...