This page is used to 'host' a personnal Knowledge Base with some short gists, cheatsheets and bookmarked-urls.

sql> select * from KB_cards where tags like '%certificate%'
All KB cards
Set the certificate private key password in a shell variable INKEY="<<CERT_PASSPHRASE>>" Get a PFX file from original cert openssl pkcs12 -export \ -in <<fqdn>>.crt \ -inkey <<fqdn>>.key \ -certfile ca-root.crt \ -name "rui" \ -passout pass:$INKEY \ -out <<fqdn>>.pfx Get PEM file from orginial cert openssl pkcs12 \ -in <<fqdn>>.pfx \ -inkey <<fqdn>>.key \ -out <<fqdn>>.pem \ -nodes \ -passin pass:$INKEY Replace lighttpd certificates mv /opt/vmware/etc/lighttpd/server.pem /opt/vmware/etc/lighttpd/server.pem-bak cp <<fqdn>>.pem /opt/vmware/etc/lighttpd/server.pem service vami-lighttp restart
Export the SSL certificate(s) of a server to a .pem file: TARGET_HOST="fqdn_of_target_host" TARGET_PORT="443" openssl s_client -showcerts -connect $TARGET_HOST:$TARGET_PORT </dev/null 2>/dev/null|openssl x509 -outform PEM > $TARGET_HOST.pem