SSL
Generating and procuring certificate
- Open a command prompt
- set the environment by running the setDomainEnv script
- Generate the private – public key pair. You can use keytool java utility, or other utilities like openssl etc.
keytool -genkey -alias client -keyalg RSA -keysize 2048 -keystore identity.jks -storepass password -keypass password
- Generate a Certificate Signing Request (CSR) and send it to Certifying Authority.
keytool -certreq -keyalg RSA -keysize 2048 -alias client -file certreq.csr -keystore identity.jks -storepass password
- The CA returns the certificate reply and the RootCA, and sometimes an intermediateCA certificate.
- Import the certificates into the keystore
- Either by importing the certificates in an order of RootCA, intermediateCA and then Certificate reply.
- Or create a certificate chain clubbing them in an order into a .pem file.
keytool -import -file CertChain.pem -alias client -keystore identity.jks -storepass password
- Create a trust keystore, this can be done my importing your RootCA certificate into another keystore that constitutes the trust:
keytool -import -file rootCA.cer -alias RootCA -keystore trust.jks -storepass password
- To verify the contents of the keystore, use this command:
Keytool –list –v –keystore <keystore-name> -storepass <keystore-password>
Configuring the keystore on the WebLogic Server
If you enable the SSL for a WebLogic Server, is is One Way SSL by default. If you want to change to Two Way SSL, you would have to select the two way SSL behavior from the Advanced option list.
- Log into the Admin Console
- Select the server on which you want to configure the SSL certificate.
- Click Server
- Click on the Keystore tab. By default it points to the Demo Certificates.
- Select Custom Identity and Custom Trust in the dropdown list.
- Enter the identity and trust keystore details
- Click on the SSL tab and enter the alias of the private key - in this case the client - and the keypass password.
- Configure the SSL port. Default is 7002.
- Go to server → General tab → Specify
- Enable SSL port
- You can see the below messages in the server logs which indicate that the certificates are loaded.
<Notice> <Security> <BEA-090171> <Loading the identity certificate and private key stored under the alias client from the JKS keystore file C:\Wonders\WebLogic\Security\SSL-Certs\Verisign\identityVerisign.jks.>
<Notice> <Security> <BEA-090169> <Loading trustedcertificates from the JKS keystore file [yourpath]\WebLogic\Security\SSL-Certs\Verisign\trustVerisign.jks.>
Test SSL setup
You can test the setup by accessing the administrator console if SSL is configured for Admin Server or any application deployed on the server by accessing it on https protocol: https://localhost:7002/console
You must verify whether the right certificate is configured or not.
- Click on the certificate details.
- Find the details about the identity and the RootCA along with the certificate chain.
For a production environment make sure that CN (Common Name) of the certificate matches the server host name. You can also use self signed certificates or trial certificates for testing purpose. However is it not recommended to use them in production environments.