As an engineer, administrator, operator, or developer, sometimes you need to learn certificate information from an application, host system, or whatever else. Almost all modern browsers allow you to get certificate information by simply clicking a red/green or crossed lock icon or following page information agents.
But sometimes you can't use browsers, and you can't leave your CLI session due to a lack of connection problem or other factors. You can use the OpenSSL CLI tool to get basic certificate information on Linux. Openssl is a handy tool that allows you to save a bunch of certificate-based requirements, including getting certificates, renewing, generating a new one and of course getting information from them.
In this article, you simply get the certificate information from a saved certificate.
[ozgurkkisa@workstation]$ openssl x509 -in \ wildcard-api.pem -noout -subject -issuer -ext 'subjectAltName' -dates subject=C = US, ST = NC, L = Raleigh, O = "Red Hat, Inc.", OU = Training,CN = *.apps.ocp4.example.com
issuer=C = US, ST = NC, L = Raleigh, O = "Red Hat, Inc.", OU = Training, CN = GLS Training Classroom Certificate Authority X509v3 Subject Alternative Name:DNS:*.apps.ocp4.example.com, DNS:api.ocp4.example.com
notBefore=Sep 2 14:11:33 2021 GMT notAfter=Aug 31 14:11:33 2031 GMT
[ozgurkkisa@workstation]$ openssl s_client -connect www.google.com:443 -showcerts
Comments
Post a Comment