T The Triage ManualTechnical Guides for IT Emergencies
P4 · PKI & Certificate Management

Inspect Full Remote SSL Certificate Details via OpenSSL CLI

curl's verbose mode (-vvI) only exposes basic certificate common names during HTTPS connections, making it insufficient for verifying issuer chains, validity dates, Subject Alternative Names, or signature algorithms. OpenSSL's s_client combined with openssl x509 provides complete x509 certificate metadata from the command line without requiring a browser. This technique is applicable to diagnostics, automation scripts, and certificate monitoring pipelines.

Indicators

Likely causes

Diagnostic steps

  1. Confirm the limitation of curl output: run 'curl -vvI https://gnupg.org' and observe that only certificate common names are shown, with no validity dates, SANs, or issuer chain detail.
  2. Use openssl s_client to retrieve the full certificate chain in PEM format: echo | openssl s_client -showcerts -servername gnupg.org -connect gnupg.org:443 2>/dev/null
  3. Pipe the PEM output through openssl x509 to parse and display all certificate fields: echo | openssl s_client -showcerts -servername gnupg.org -connect gnupg.org:443 2>/dev/null | openssl x509 -inform pem -noout -text
  4. Review the parsed output for: Subject, Issuer, Validity (Not Before / Not After), Subject Alternative Names (SANs), Public Key algorithm, and Signature algorithm.
  5. If the target server hosts multiple virtual hosts, verify the -servername parameter exactly matches the intended hostname to ensure SNI triggers selection of the correct certificate.
  6. To check expiry dates only (useful in monitoring scripts), run: echo | openssl s_client -servername gnupg.org -connect gnupg.org:443 2>/dev/null | openssl x509 -noout -dates

Resolution path

Prevention

Tools

References

ssltlsopensslcertificatex509curlclihttpssnis_clientcertificate-inspectionpkidiagnosticsexpiry-checksancertificate-chain