wiki:openssl_commands
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| wiki:openssl_commands [2022/10/19 12:31] – [Query site for expiration date] fix whitespace and newline antisa | wiki:openssl_commands [2025/10/16 08:46] (current) – add CSR check command and fix indent antisa | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| ====== Openssl commands ====== | ====== Openssl commands ====== | ||
| + | ===== Check CSR ===== | ||
| + | openssl req -text -noout -verify -in google.com.csr | ||
| + | | ||
| ===== Get cert expiration date from cert file ===== | ===== Get cert expiration date from cert file ===== | ||
| - | openssl x509 -enddate -noout -in / | + | |
| ===== Verfiy certs ===== | ===== Verfiy certs ===== | ||
| - | openssl verify -CAfile certs/ | + | |
| - | openssl verify -CAfile certs/ | + | |
| ===== Query site for expiration date ===== | ===== Query site for expiration date ===== | ||
| Line 35: | Line 38: | ||
| ===== Get cert file from site ===== | ===== Get cert file from site ===== | ||
| - | openssl s_client -connect example.com: | + | openssl s_client -connect example.com: |
| + | |||
| + | <WRAP center round info 60%> | ||
| + | -connect can be the IP address of a server and is not necessarily the same as the -servername. Use -servername when sharing multiple SSL hosts on a single IP address, | ||
| + | </ | ||
| ===== Get OCSP stapling info ===== | ===== Get OCSP stapling info ===== | ||
| Line 54: | Line 61: | ||
| You need to get the same sha sum from both commands. | You need to get the same sha sum from both commands. | ||
| + | |||
| + | |||
| + | |||
| + | ===== Additional commands that can be used to inspect Certificates ===== | ||
| + | |||
| + | The openssl x509 utility also allows you to extract specific pieces of information from the certificate file instead of the entire content of a certificate in text. | ||
| + | |||
| + | openssl x509 -in google.com-cert -noout -serial | ||
| + | |||
| + | openssl x509 -in google.com-cert -noout -issuer | ||
| + | |||
| + | openssl x509 -in google.com-cert -noout -dates | ||
| + | |||
| + | openssl x509 -in google.com-cert -noout -subject | ||
| + | |||
| + | openssl x509 -in google.com-cert -noout -pubkey | ||
| + | |||
| + | openssl x509 -in google.com-cert -noout -modulus | ||
| + | |||
| + | openssl x509 -in google.com-cert -noout -ocsp_uri | ||
| + | Note: Last command may not work in all versions of OpenSSL | ||
| + | |||
| + | You can also mix and match arguments from the last step: | ||
| + | |||
| + | openssl x509 -in google.com-cert -noout -subject -issuer | ||
| + | |||
| + | openssl x509 -in google.com-cert -noout -serial -dates | ||
| + | |||
| + | You can also request specific extensions from the certificate: | ||
| + | |||
| + | openssl x509 -in google.com-cert -noout -ext subjectAltName | ||
| + | |||
| + | openssl x509 -in google.com-cert -noout -ext basicConstraints | ||
| + | |||
| + | openssl x509 -in google.com-cert -noout -ext crlDistributionPoints | ||
| + | |||
| + | openssl x509 -in google.com-cert -noout -ext keyUsage | ||
| + | |||
| + | openssl x509 -in google.com-cert -noout -ext extendedKeyUsage | ||
| + | |||
| + | openssl x509 -in google.com-cert -noout -ext authorityInfoAccess | ||
| + | |||
| + | openssl x509 -in google.com-cert -noout -ext subjectKeyIdentifier | ||
| + | |||
| + | openssl x509 -in google.com-cert -noout -ext authorityKeyIdentifier | ||
| + | |||
| + | |||
| + | ====== See also ====== | ||
| + | * [[wiki: | ||
| + | |||
| ====== References ====== | ====== References ====== | ||
| * https:// | * https:// | ||
| * https:// | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
wiki/openssl_commands.1666182699.txt.gz · Last modified: by antisa
