Please note: A PDF version of this guide is available for download at the bottom of the article.
Overview: This guide will cover how to import the application server’s SSL certificate into the Java Keystore and TrustStore file. This is required for interfaces such as CITI Feed, LDAPS, SSO, IMAPS, etc…
- Prerequisites:
- The SSL cert applied to the site in IIS
- Need portecle.zip (can be provided by iMedRIS)
- Need jetty.zip (can be provided by iMedRIS)
- Note: it is possible that this setup has already been completed for different interfaces. All of step two is just to check whether or not some of the requirements have been set up already.
Have they been configured in sa.properties?
- Open up the sa.properties file
- Check to see if the following lines are not commented out and have a value:
- system.keyStore_1
- system.keyStorePassword_1
- system.trustStore_1
- system.trustStorePassword_1
- If there is a file path listed for system.keyStore_1 and a password listed for system.keyStorePassword_1 then the JKS file has been created and will need to be verified (follow section 3).
- If there is a file path listed for system.trustStore_1 and a password listed for system.trustStorePassword_1 then the JKS file has been created and will need to be verified (follow section 3).
- Verify KeyStore and TrustStore
Verify (only if the keyStore and/or trustStore exist – Otherwise skip to section 4):
- Extract the portecle.zip file to the desktop
- Open up the command prompt and change directory to the extracted portecle folder.
- Run the following command:
- > java –jar portecle.jar
- The portecle GUI will now open.
Verify Java KeyStore
- Click the open button (highlighted above) and select the file path for the system.KeyStore_1
- Enter the system.keyStorePassword_1 when prompted for the password
- Once the key-store has been opened there should be a key-pair.
- Right click and select certificate details
- Make sure that the certificate is the SSL certificate for the application server.
Verify TrustStore
- Click the open button and select the file path for the system.trustStore_1
- Enter the system.trustStorePassword_1 when prompted for the password
- Once the trust-store has been opened you will find many certificates that have been imported
- Sort by date and look at the newest cert
- Right click and select certificate details
- Make sure that the certificate is the SSL certificate for the application server.
If both of the above have been verified to have the SSL certificate for the URL in it, then interfaces should work over HTTPS when configured and the rest of the guide can be skipped.
- TrustStore Setup Pre-req:
Download the .cer from the SSL protected site:
- Navigate to the iRIS site that the interface is being set up on
- Click the lock icon and select view certificate
- Select the Details tab and then click the Copy to File button
- In the window that opens, select the DER encoded binary X.509 (.CER) option.
- Choose where to save to file. Click next and then click finish on the following page.
- Import into TrustStore
- Using Portecle, open the TrustStore:
- Default Path: %IMEDRIS_HOME%\jdk*\jre\lib\security\cacerts
- Default Password: changeit
- Click the certificate import button
- Select the DER converted file (from the previous section) and import.
- Once the file is imported click the Save button
- Add the TrustStore to the sa.properties file
First change the password:
- With the TrustStore already open, go to Tools 🡪 Set Keystore Password
- Enter the new password and then save the KeyStore.
- Change to the %IMEDRIS_HOME%\jdk*\jre\lib\security directory.
Add to sa.properties:
- Add the %IMEDRIS_HOME%\jdk*\jre\lib\security\cacerts path to the system.trustStore_1 property. Make sure that there are two ‘\’ for every 1 ‘\’ in the path
- Ex: C:\iMedRIS\ jdk1.7.0_67\jre\lib\security\cacerts 🡪 C:\\iMedRIS\\ jdk1.7.0_67\\jre\\lib\\security\\cacerts
- Add the password used for the cacert trustStore password to the system.trustStorePassword_1 property.
- JKS pre-req – Get certificate in .PFX format
This can be skipped if you already have the application server’s cert in .PFX format.
- Open up IIS on the application server
- Select the server name in the right pane and then double-click on Server Certificates in the middle pane
- Right-click the certificate used for the website and select Export…
- Note: Some certificates do not allow export – you must obtain the .PFX SSL certificate and a password for it from someone at your institution
- Enter the filename and path for the .PFX file to be exported and assign it a password
- Create the Java Key Store using Jetty
- Extract the Jetty.zip onto the desktop
- Open up command line and change directory to the extracted folder.
- Run the following command:
- > java -classpath lib\jetty-6.1.1.jar org.mortbay.jetty.security.PKCS12Import <cert_pfx_file_path> %IMEDRIS_HOME%\jdk*\jre\lib\security\keystore.jks
- Input keystore passphrase = <password when exporting the cert from IIS or converting key to .pfx format>
- Output keystore passphrase = <choose password>
- Add the %IMEDRIS_HOME% \jdk* \jre\lib \security\<keystore>.jks path to the system.keyStore_1 property. Make sure that there are two ‘\’ for every one ‘\’ in the path
- Ex: C:\iMedRIS\ jdk1.7.0_67\jre\lib\security\keystore.jks 🡪 C:\\iMedRIS\\ jdk1.7.0_67\\jre\\lib\\security\keystore.jks
- Add the password used for the keyStore to the system.keyStorePassword_1 property.
- Restart iRIS