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 CERTParameters & Attributes
| Name | Type | Description |
|---|---|---|
| verify | operand | Certificate verification subcommand |
| -CAfile | option | Trusted certificates |
| -verify_hostname | option | Expected DNS name |
| CERT | operand | Certificate 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