Enabling SSL in JBoss Server


Difference between HTTP and HTTPS

Both HTTP and HTTPS are protocols used for client-server communication. The difference being that, in case of HTTPS, the communication between the client( usually a web browser ) and server ( usually a web server ) is done in an encrypted fromat. This is achieved by using SSL.

Find more about SSL here : SSL Guide for Openfire

Enabling SSL in JBoss App Server

To enable HTTPS or SSL connection in JBoss, one needs to create a keystore which will contain Self Signed Certificates that the JBoss server will use to communicate with the client. Use the following java command to create the keystore.

keytool -genkey -alias tomcat -keyalg RSA -keystore NAME_OF_KEYSTORE -validity NUMBER_OF_DAYS

Example : keytool -genkey -alias tomcat -keyalg RSA -keystore JBoss_KS_Arun -validity 60

This will create a keystore in the name JBoss_KS_Arun. Copy this to the jboss/server/default/conf/ directory in JBoss. Then modify the server.xml as follows

 <Connector port=”8443″ protocol=”HTTP/1.1″ SSLEnabled=”true”
maxThreads=”150″ scheme=”https” secure=”true”
clientAuth=”false”
strategy=”ms”
address=”${jboss.bind.address}”
keystoreFile=”${jboss.server.home.dir}/conf/JBoss_KS_Arun”
keystorePass=”JBoss_KS_Arun”
truststoreFile=”${jboss.server.home.dir}/conf/JBoss_KS_Arun”
truststorePass=”JBoss_KS_Arun”
sslProtocol=”TLS”/>

Now try hitting the server @ https://localhost:8443. You should be able to see the JBoss welcome screen. 🙂 🙂

The other option to Self Signed Certificates is to use certificates from Certification Authorities ( CA ) like verisign. To find the difference both, use this link

Cheers,

The Nonsense Logger

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s