I have a client.pem file with a password "password" I have used this in an stunnel to connect to a webservice.
Now instead I wish to use javas keyStore and trustStore. How do I translate this working .pem file into a working keyStore?
I tried this: Import PEM into Java Key Store
to add it to the cacerts file, thinking I can use this for the truststore.
I read somewhere that the cacerts file is in fact a jks file?
So shouldn't I be able to do it like this:
-Djavax.net.ssl.keyStore="C:\cacerts"
-Djavax.net.ssl.keyStoreType="JKS"
-Djavax.net.ssl.keyStorePassword="changeit"
-Djavax.net.ssl.trustStore="C:\cacerts"
-Djavax.net.ssl.trustStorePassword="changeit"
This did not work. And I guess it shouldn't since the original password for the client.pem is not used anywhere. But how do I do this? Should the truststore file be ok? If so how do I create a Keystore.
Thanks for any help.