Install two certificates in the Key Store

Dear All, 

I need to access to two differente Jasper Servers located at two different  web servers, each of them is requesting for a different SSL Certificate so I need to install these two cetificates in the Key Store (Preferences > Jaspersoft Studio > JasperReports Server Settings > KeyStore ) but it looks like there is no way to instal to certificates, the button "ADD" is not adding a new certificate, it is just replacing the one stored.

Do anybody knows how could I load the two certificates, or an alternative way to acces these two differentes srervers?

Thank you

aburgos_2's picture
Joined: Jan 7 2022 - 1:28am
Last seen: 3 months 2 weeks ago

Thank you for posting to the Jaspersoft Community. Our team of experts has read your question and we are working to get you an answer as quickly as we can. If you have a Jaspersoft Professional Subscription plan, please visit https://support.tibco.com/s/ for direct access to our technical support teams offering guaranteed response times.

arai_4 - 4 months 3 weeks ago

1 Answer:

Hi aburgos_2,

The solution is to prepare a keystore with the two certificates.

Suppose you have two certificates (server1.cer and server2.cer). Below is an example to add these two certificates to the same keystore using Java tool. You can use OpenSSL too to do the same.

By using a recent version Java, i.e. java 11, create the key store with the following commands: 

keytool -import -keystore myStore.jks -alias Server1 -file server1.cer 
keytool -import -keystore myStore.jks -alias Server2 -file server2.cer 

You can verify that both the certs are in the store by running: 

keytool -list -keystore myStore.jks 

You should see the two certs in the output if both are successfully added to the keystore.

Keystore type: PKCS12 
Keystore provider: SUN 

Your keystore contains 2 entries

server1, May 17, 2023, trustedCertEntry, Certificate fingerprint (SHA-256): CA:3B:B2:FB:A3:1C:30:90:C2:CA:89:F0:F0:BD:BC:1A:65:1A:AA:29:44:E8:AA:25:9C:af:6D:bc:33:EA:6F:95 
server2, May 17, 2023, trustedCertEntry, Certificate fingerprint (SHA-256): 73:A5:89:84:5D:9F:C6:A6:5F:44:3F:D5:32:16:70:EE:F9:14:C0:F4:11:BA:35:76:A5:17:0B:A8:0D:66:20:55 

Then you can import this keystore with both the certificates i.e. myStore.jks in Jaspersoft Studio.

Thanks.

jmand's picture
122
Joined: Feb 8 2023 - 11:19am
Last seen: 6 days 15 hours ago
Feedback
randomness