Configuring SSL in Wildfly 8/9/10

Note: this guide is still relevant for Wildfly 9 and Wildfly 10

I’ve just set up a couple of servers running Wildfly 8 and they needed SSL certificates to enable HTTPS. The following documents the steps required to generate the SSL certificate and install/configure it in Wildfly.

You can get some cheap SSL certificates here: https://www.ssls.com

First you need to create a CSR (certificate signing request). It’s recommended to use at least a 2048 bit key and you can generate one with the following command:

The output will be similar to the following:

Next answer the questions you are prompted for:

Finally you are ready to request your SSL certificate. Go and purchase a certificate from any trusted SSL certificate provider. A standard certificate is probably all you need for basic security. I get mine from: https://www.ssls.com.

After purchasing you will need to activate your certificate. Your provider will ask you to copy and paste in the CSR you created above. Copy everything in that file.

After your certificate is issued download it (and unzip if needed). You will also need the CA (Certificate Authority) root bundle. This is basically the SSL certificate providers credentials proving they are trusted. Once you have these you need to create a Java keystore file. This is a two step process. First creating a pkcs12 file from your SSL certificate and then importing that into a keystore file.

Step 1

 

Step 2

Copy the new keystore file to the your Wildfly configuration directory

 

Insert the following into your standalone.xml in the security-realms section.

Add the following line to the server section of the standalone.xml file.

After restarting Wildfly you should now have functioning HTTPS.

2 comments for “Configuring SSL in Wildfly 8/9/10

Comments are closed.