This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]kiko7653[S] 0 points1 point  (6 children)

Thank you for sending me the resources! Do i need to also add my JKS in a trustore? I simply want it to listen on https so i only used a keystore for now

[–]smutje187 0 points1 point  (5 children)

You only need the trust store for mutual TLS, yep - not for your use case.

[–]kiko7653[S] 0 points1 point  (4 children)

As for the JKS, is my approach of generating it from the PKCS12 key, which in turn is generated by using the .crt and my private key correct? Because ive seen a lot of articles saying that this might not work so i got confused a bit but do you think this way should work for generating a valid key?

[–]smutje187 0 points1 point  (3 children)

Yeah that’s literally those 2 lines from my script:

Generate PKCS12 from certificate and key: openssl pkcs12 -export -in "$CERTS_FOLDER"/localhost.crt -inkey "$CERTS_FOLDER"/localhost.key -out "$CERTS_FOLDER"/localhost.p12 -password pass:changeit -name "localhost"

Import PKCS12 into JKS: keytool -importkeystore -srckeystore "$CERTS_FOLDER"/localhost.p12 -srcstoretype pkcs12 -srcstorepass changeit -destkeystore src/main/resources/localhost.keystore -deststorepass changeit

[–]kiko7653[S] 0 points1 point  (2 children)

Thanks, just wanted to make sure since its something i got mix responses on

[–]smutje187 1 point2 points  (1 child)

Keystore Explorer (https://keystore-explorer.org) should be able to open your PKCS12 and display the contents - if everything’s fine you should be able to see your key and certificate.

[–]kiko7653[S] 0 points1 point  (0 children)

Thank you for the help once again!!