Code Snippet

Just another Code Snippet site

[How-To] Certificate

#extract the certificate to a pem file

openssl pkcs12 -in certificate.p12 -out certificate.crt.pem -clcerts -nokeys

#extract the key to another pem file

openssl pkcs12 -in certificate.p12 -out certificate.key.pem -nocerts -nodes

#Import the the certificate into JDKs cacerts keystore

keytool -import -alias MY_ALIAS -file /root/certificate.crt.pem -keystore /opt/app/java/current/jre/lib/security/cacerts

cURL HTTPS with client certificate :

curl --key ./mykey.key --cert ./mycert.pem -k -v https://target.com

,


3 thoughts on “[How-To] Certificate

Leave a Reply

Your email address will not be published. Required fields are marked *