简体   繁体   中英

How to use 2 or more jks certificate files at the same time?

Before this,I need to configure a keystore (.jks) in the project in order to use the mq service.I added it in the Dockerfile:

ENTRYPOINT ["java", "-Djavax.net.ssl.keyStoreType=jks", "-Djavax.net.ssl.keyStore=xxx.jks", "-Djavax.net.ssl.keyStorePassword=xxx", "-jare", "app.jar"]

This is very simple and it can work after deploying it to kubernetes.

But recently I need to use Hazelcast in the same project, that requires me to add a new.jks file.

How should I make these 2 jks work at the same time in one project? (Someone told me that it seems possible to merge two jks, but I want to keep 2.jks)

As your question specifies you would like to keep the two keystores separate, this is not quite the answer you want. But if you conclude that there is no way to load two keystores (which is possible) in a satisfactory manner, here is how you combine them.

keytool -importkeystore -srckeystore yyy.jks -destkeysore xxx.jks

This will import certificates from yyy into xxx.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM