HTTPS Certs/OpenSSL
HTTPS Certs/OpenSSL
Section titled “HTTPS Certs/OpenSSL”Convert certificates
Section titled “Convert certificates”# pem -> deropenssl x509 -in cert.pem -outform der -out cert.der# der -> pemopenssl x509 -in cert.der -inform der -out cert.pem# combine key + cert into pkcs#12openssl pkcs12 -export -out bundle.p12 -inkey privkey.pem -in cert.pem -certfile chain.pem# extract keyopenssl pkcs12 -in bundle.p12 -nocerts -out privkey.pemopenssl pkcs12 -in bundle.p12 -nokeys -out cert.pemInstall Certificates
Section titled “Install Certificates”# update trustsudo update-ca-certificatessudo cp my-ca.pem /etc/pki/ca-trust/source/anchors/sudo update-ca-trustInstall cert for svc like nginx
Section titled “Install cert for svc like nginx”sudo cp cert.pem /etc/nginx/ssl/sudo cp privkey.pem /etc/nginx/ssl/sudo systemctl reload nginxCheck certs
Section titled “Check certs”# check cert detailsopenssl x509 -in cert.pem -text -noout# check enddateopenssl x509 -enddate -noout -in cert.pem# Validate against caopenssl verify -CAfile ca.pem cert.pem# check remote server certopenssl s_client -connect example.com:443 -servername example.com