Monday, February 25, 2013

Configure JBoss to https port

1. Creating the keystore and private key:

      a. Open a command prompt or shell and go to the default/conf folder.
      keytool -genkey -alias jbosskey -keypass changeit -keyalg RSA -keystore server.keystore
      b. Answer the prompts. Use 'localhost' when asked for first/last name. This is critical.
      c.server.keystore is generated.

2.Generating and storing the certificate.

      keytool -export -alias jbosskey -keypass changeit -file server.crt -keystore server.keystore
      a. server.crt is generated.
      b. keytool -import -alias jbosscert -keypass changeit -file server.crt -keystore server.keystore
      c.yes

      3. Edt "C:/yourServerLocation>/server/default/deploy/jboss-web.deployer/server.xml"

      a. Uncomment the section that begins with Connector port="8443"
      b. At the end of the section (but still inside of it) add:
      keystoreFile="/conf/server.keystore"
      keystorePass="changeit"

      4. Edit run.bat

      a. add
      set JAVA_OPTS=%JAVA_OPTS% -Djavax.net.ssl.trustStore="D:\jboss-4.2.2.GA\server\default\conf\server.keystore"
     b.save it