commands

openssl — Verify a certificate and hostname

Verify a certificate against a specified trust anchor and expected hostname. This is offline validation, not a TLS handshake. Do not expose keys. Use a fresh private workspace; system service changes are VM-only.

Formal Syntax & Structure

linux syntaxlinux
openssl verify -CAfile CA_FILE -verify_hostname NAME CERT

Parameters & Attributes

NameTypeDescription
verifyoperandCertificate verification subcommand
-CAfileoptionTrusted certificates
-verify_hostnameoptionExpected DNS name
CERToperandCertificate to check

Return Value

exit status and output

The verify operation reports certificate verification against the supplied trust anchor and hostname; success is normally reported as certificate: OK. Verification failure is nonzero and includes diagnostics. It does not test a live TLS connection.

Working Example

Example Snippetlinux
python3 local_hosting.py cert-match
Linux Reference