Enable SSL in jboss with self-signed or test certificate

Enable SSL in jboss with self-signed or test certificate


1.       Fist set Environment variable for system
     set PATH="C:\Program Files\Java\jdk1.6.0_06\jre\bin";%PATH%

2.       jBoss recommends using the same file as both keystore and trustore.  This will be server.keystore.  In a virgin install there should be no server.keystore in the default/conf folder.  If you have one, you must decide whether to delete it (to use these instructions) or whether to adapt the instructions to suit your situation.
  1. Creating the keystore and private key:
    1. Open a command prompt or shell and go to the default/conf folder.
    2. keytool -genkey -alias jbosskey -keypass changeit -keyalg RSA -keystore server.keystore
    3. Answer the prompts.  Use myHostname when asked for first/last name.  This is critical.

    1. server.keystore is generated.
    2. keytool -list -keystore server.keystore
    1. You should see the PrivateKeyEntry named jbosskey in the listing.

  1. Generating and storing the certificate.
    1. keytool -export -alias jbosskey -keypass changeit -file server.crt -keystore server.keystore
    1. server.crt is generated.
    2. keytool -import -alias jbosscert -keypass changeit -file server.crt -keystore server.keystore
    3. You receive a warning that it already exists in the keystore.  Ignore it.  It is because Java expects separate keystore adn trustore files and we are using only one.
    4. keytool -list -keystore server.keystore
    1. You should see a TrustedCertEntry named jbosscert in the listing.

  1. Enable jBoss' Tomcat for HTTPS:
    1. Edt "<C:/yourServerLocation>/server/default/deploy/jbossweb.sar/server.xml"
    2. Uncomment the section that begins with <Connector port="8443"
    3. At the end of the section (but still inside of it) add:
                                          i.    keystoreFile="${jboss.server.home.dir}/conf/server.keystore"
                                         ii.    keystorePass="changeit"
6.       Finally run jboss using “run -c default -b 0.0.0.0” in cmd prompt


Comments

Popular posts from this blog

SinglePass Terms of Service

Jasper Report Viruatization

JasperReports Tutorial