Difference between revisions of "Openssl"
Jump to navigation
Jump to search
Line 23: | Line 23: | ||
openssl s_client -servername google.com -connect google.com:8201 | openssl x509 -noout -dates | openssl s_client -servername google.com -connect google.com:8201 | openssl x509 -noout -dates | ||
``` | ``` | ||
+ | |||
+ | ``` | ||
+ | echo quit | openssl s_client -showcerts -servername server -connect google.com:443 > cacert.pem | ||
+ | true | openssl s_client -connect google.com:443 2>/dev/null | openssl x509 | ||
+ | rm -f cert.pem && echo -n | openssl s_client -connect google.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ./cert.pem | ||
+ | ``` | ||
+ | curl --cacert google.pem https://google.com |
Revision as of 16:46, 25 June 2021
https://www.redhat.com/sysadmin/6-openssl-commands
Extract cert and key
openssl pkcs12 -in domain.pfx -clcerts -nokeys -out domain.crt openssl pkcs12 -in domain.pfx -nocerts -nodes -out domain.key
Update your Apache configuration file with:
<VirtualHost 192.168.0.1:443> ... SSLEngine on SSLCertificateFile /path/to/domain.crt SSLCertificateKeyFile /path/to/domain.key ... </VirtualHost>
openssl s_client -servername google.com -connect google.com:8201 | openssl x509 -noout -dates
echo quit | openssl s_client -showcerts -servername server -connect google.com:443 > cacert.pem true | openssl s_client -connect google.com:443 2>/dev/null | openssl x509 rm -f cert.pem && echo -n | openssl s_client -connect google.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ./cert.pem
curl --cacert google.pem https://google.com