How-To Install StartSSL XMPP Certificate In Openfire 3.6.4
Sunday, April 18th, 2010I recently discovered StartCom’s free Class 1 SSL certificates and decided to request some for my server. I figured, why not start with Jabber? The Openfire admin interface makes it seem simple enough. Well, it’s not as straight-forward as it sounds, but it’s relatively easy once you know what to do.
Your server must be running JRE 6 with the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 6 to be able to use a certificate generated by StartCom.
My experience is Debian based, so these instructions will be written as such. All terminal commands below are performed as root.
Step 0 – Delete Existing Certificates
Log in to your Openfire server at http://yourserver:9090
Under “Server Settings” select “Server Certificates”
Delete all listed certificates.
Step 1 – Install and configure JRE 6
To install Java 6 JRE, simply do:
apt-get install sun-java6-jre
Next, we want to make sure JRE 6 is the default for java on our server.
update-alternatives --config java
Be sure to select the option corresponding to /usr/lib/jvm/java-6-sun/jre/bin/java (option 3 on my server).
Step 2 – Install JCE Unlimited Strength Jurisdiction Policy Files 6
Download the files from http://java.sun.com/javase/downloads/index.jsp
Copy the files US_export_policy.jar and local_policy.jar to /usr/lib/jvm/java-6-sun/jre/lib/security overwriting what already exist. Be sure to retain the permissions the old files had.
Openfire will continue to use the old JRE until its environment variables are updated. I was too lazy to do this, so I rebooted my server. This worked for me!
Step 3 – Obtain Private Key & Certificate From StartCom
Go to https://www.startssl.com/ and go through the process of creating an account (if you haven’t already). Then request a Jabber/XMPP certificate through them for your server. Don’t use an Openfire generated CSR, let StartCom generate the private key for you.
Save the private key and its password!! If you lose this, your certificate will be invalid and you will NOT be able to re-request the certificate from StartCom! We will be using it in a later step.
Note: Since StartCom is generating the private key, you may have to wait a few hours for your request to be confirmed.
Step 4 – Install StartCom’s Class 1 Intermediate and Root Certificates
Note: You can perform this step while you’re waiting for your certificate to be generated.
Download StartCom’s class1 intermediate certificate here: https://www.startssl.com/certs/sub.class1.server.ca.pem and StartCom’s root certificate here: https://www.startssl.com/certs/ca.pem.
Copy the root and intermediate certificates to a logical location in your server. I worked in ~/ssl/ to keep things organized.
To install the certificates, use the following commands (each command is 1 line):
keytool -import -trustcacerts -alias startcom.ca -file ca.pem -keystore /usr/share/openfire/resources/security/truststore
keytool -import -trustcacerts -alias startcom.ca.sub -file sub.class1.server.ca.pem -keystore /usr/share/openfire/resources/security/truststore
You will be prompted for a password. The default password is “changeit”.
(It is recommended that you change the keystore and truststore passwords. For instructions on how to do this, see http://www.igniterealtime.org/builds/openfire/docs/latest/documentation/ssl-guide.html)
Step 5 – Additional Openfire Configuring
Browse to your Openfire server at http://yourserver:9090
Under “Server Manager”, select “System Properties”
Add/edit the following properties with the following values:
Property Name – Property Value
xmpp.socket.ssl.active – true
xmpp.socket.ssl.port – 5223
xmpp.socket.ssl.storeType – JKS
xmpp.socket.ssl.keystore – resources/security/keystore
xmpp.socket.ssl.keypass – changeit
xmpp.socket.ssl.truststore – resources/security/truststore
xmpp.socket.ssl.trustpass – changeit
(It’s recommended that you change the keystore and truststore passwords. See http://www.igniterealtime.org/builds/openfire/docs/latest/documentation/ssl-guide.htmlfor instructions on how to do this.)
Step 6 – Installing Private Key & Certificate
Now we’re ready to install the certificate! Log back into your Openfire server at http://yourserver:9090.
Under “Server Settings” select “Server Certificates”. You should be prompted with the message
“One or more certificates are missing. Click here to generate self-signed certificates or here to import a signed certificate and its private key.”
Click the second link corresponding to importing a signed certificate.
In the first field, type your private key’s password. Copy the private key generated by StartCom and paste it in the second field. Copy the XMPP certificate generated by StartCom and paste it in the 3rd field.
Click save. You should now be back at the “Server Certificates” page with your certificate listed below. You will still be prompted with the “One or more certificates are missing.” error, but simply ignore it. This is because Openfire is looking for an RSA and a DSA certificate. You don’t need both.
Restart Openfire and…success!



