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.
- Creating the keystore and private key:
- Open a command prompt or shell and go to the default/conf folder.
- keytool -genkey -alias jbosskey -keypass changeit
-keyalg RSA -keystore server.keystore
- Answer the prompts. Use myHostname when
asked for first/last name. This is critical.
- server.keystore is
generated.
- keytool -list -keystore server.keystore
- You should see the PrivateKeyEntry named jbosskey in
the listing.
- Generating and storing the certificate.
- keytool -export -alias jbosskey -keypass changeit
-file server.crt -keystore server.keystore
- server.crt is
generated.
- keytool -import -alias jbosscert -keypass changeit
-file server.crt -keystore server.keystore
- 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.
- keytool -list -keystore server.keystore
- You should see a TrustedCertEntry named jbosscert in
the listing.
- Enable jBoss' Tomcat for HTTPS:
- Edt "<C:/yourServerLocation>/server/default/deploy/jbossweb.sar/server.xml"
- Uncomment the section that begins with <Connector
port="8443"
- 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
Post a Comment