Use it to inspect or create keys and certificates, or test a TLS service.
OpenSSL
OpenSSL is the toolkit for keys, CSRs, certificates and TLS testing: openssl x509, req, pkey, verify, s_client.
1. Format? head -1 <file> (PEM) or file <file>.
2. Inspect: openssl x509 -noout -text -in <cert>.
3. Test a server: openssl s_client -connect host:443 -servername host.
4. Convert as needed (pkcs12, der).
5. Version: openssl version.
file or server → openssl subcommand → decoded or tested → result
For Certificates & TLS → OpenSSL, continue with the first unproven Topic check: Record exact host, distribution/kernel, boot ID, time window, workload, identity and the authoritative configuration/policy source for OpenSSL. If that boundary is healthy, advance to the adjacent check: Read back the effective runtime state and precedence rather than assuming an edited file, package state or service status is active. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.
Continue only after interpreting the current observation.Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
openssl x509 -in cert.pem -noout -textVerification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Operational evidence path Verify boundary
input key/cert/CSR or endpoint → OpenSSL parser/crypto operation → verification options/trust/SNI → result → compare with service/client runtime
Healthy evidence: commands parse expected objects, cryptographic matches/checks succeed with explicit options and live test agrees with the production endpoint/client path
Step 2 Verification and output interpretation Verify boundary
Verification chain. input key/cert/CSR or endpoint → OpenSSL parser/crypto operation → verification options/trust/SNI → result → compare with service/client runtime
Step 3 Specialized verification Verify boundary
For a server, connect to the exact host/port with SNI and capture the presented leaf/intermediate chain, negotiated version/cipher and verification result. Inspect SANs, validity and issuer relationships separately. For a local key/certificate pair, compare public-key material rather than filenames. Reproduce using the application’s trust/hostname expectations where possible. A successful TCP/TLS handshake shows transport/cryptographic negotiation, not HTTP/application authorization or content correctness.
Step 4 Commands Verify boundary
openssl version
openssl x509 -in cert.pem -noout -text
openssl req -in req.csr -noout -text
openssl s_client -connect host:443 -servername host
Step 5 Failure modes and next checks Narrow the fault
Suspicious evidence: wrong file/store is inspected, verification is omitted, SNI differs, output warnings are ignored or CLI success disagrees with the application runtime
Step 6 Special cases and limits Narrow the fault
OpenSSL verify success under one CAfile does not show another application uses that trust store. s_client can complete a handshake even while reporting a verification error depending on options/version. Certificate parsing does not show the private key matches or that the server deployed the file. TLS success does not show hostname/application correctness. Keep artifact validity, trust path, live presentation, hostname verification and application protocol separate.
Step 7 Common mistakes Narrow the fault
- Forgetting
-servername(SNI), getting the wrong certificate.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
Know the format: PEM (text, BEGIN lines) or DER (binary); PKCS#12 (.pfx) bundles key and chain. Convert with openssl x509 -inform der, openssl pkcs12. Always use -servername with s_client for SNI.
openssl x509 -in <cert> -noout -subject -issuer -dates -ext subjectAltName— certificate detailsopenssl s_client -connect <host>:443 -servername <name> </dev/null— live chain and verificationopenssl verify -CAfile <ca> -untrusted <chain> <cert>— chain validationtrust list | head / ls /etc/ssl/certs— system trust store
ReferenceImportant terms & boundaries6 sections · depth on demand
What this shows and what it does not
OpenSSL evidence is scoped to the exact command, inputs and verification options; reproduce with the real service/client before declaring success.
In depth
OpenSSL as a diagnostic toolkit
OpenSSL's command-line tool answers most TLS questions without any other software. The openssl-x509(1) manual page covers inspecting and signing certificates:
-text -nooutshows everything, and-dates,-subjectand-issuershow selected fields.-fingerprintprints a digest of the whole certificate.-informand-outformconvert between PEM (the default) and DER.-req -CA -CAkeysigns a request with a CA's key.
Other subcommands cover keys (genpkey, pkey), requests (req), verification (verify) and live connections (s_client).
Subcommands for everyday tasks
| Task | Command |
|---|---|
| Show a certificate | openssl x509 -in cert.pem -noout -text |
| Show a CSR | openssl req -in req.csr -noout -text -verify |
| Show a key's details | openssl pkey -in key.pem -noout -text |
| Does a key match a certificate? | Compare openssl x509 -noout -pubkey with openssl pkey -pubout |
| Convert PEM to DER | openssl x509 -in cert.pem -outform DER -out cert.der |
| Verify a chain | openssl verify -CAfile root.pem -untrusted inter.pem leaf.pem |
| Connect and show the chain | openssl s_client -connect host:443 -servername host -showcerts |
| Test a protocol version | openssl s_client -connect host:443 -tls1_2 |
| STARTTLS for mail | openssl s_client -connect mail:25 -starttls smtp |
Matching keys and certificates
A web server that refuses to start with "key values mismatch" has a certificate and key that don't belong together. Comparing digests of the two public keys shows it instantly.
host$ openssl x509 -in server.crt -noout -pubkey | openssl sha256
SHA2-256(stdin)= 9c1f4e...a71
host$ openssl pkey -in server.key -pubout | openssl sha256
SHA2-256(stdin)= 9c1f4e...a71
host$ openssl s_client -connect www.example.net:443 -servername www.example.net -brief </dev/null
CONNECTION ESTABLISHED
Protocol version: TLSv1.3
Ciphersuite: TLS_AES_256_GCM_SHA384
Peer certificate: CN = www.example.net
Verification: OK
host$ openssl s_client -connect www.example.net:443 -tls1_1 </dev/null 2>&1 | grep -E "alert|no protocols"
host$ openssl version
OpenSSL 3.0.13 30 Jan 2024
Always pass -servername
Without -servername, s_client sends no SNI. A server hosting several sites may then return a default certificate that isn't the one you wanted to check. Many "wrong certificate" findings come from forgetting this option.
Documented example, not captured output.
How it works at runtime
OpenSSL is part of Certificates & TLS → OpenSSL. OpenSSL provides Linux cryptographic and TLS tooling for inspecting keys, CSRs, certificates, chains and live handshakes; its output must be interpreted in the context of the exact file, trust store, SNI and endpoint.
Topic-specific state model. OpenSSL provides Linux cryptographic and TLS tooling for inspecting keys, CSRs, certificates, chains and live handshakes; its output must be interpreted in the context of the exact file, trust store, SNI and endpoint.
Interpretation rule. - OpenSSL command success ≠ the production application uses the same trust store, ciphers or hostname behavior.
- Readable certificate metadata ≠ verified chain or matching private key.
Specialized mechanics
OpenSSL provides cryptographic libraries and command-line tools for parsing keys/certificates, building verification paths and testing TLS handshakes. s_client exposes the live peer handshake, certificate chain and negotiated parameters, while x509, pkey, verify and related tools inspect local artifacts. The CLI is a diagnostic client; it does not automatically reproduce every application’s trust store, TLS policy, SNI/ALPN behavior or hostname verification defaults.
Quick reference
OpenSSL command reference for daily work:
openssl version -a
openssl x509 -in cert.pem -noout -subject -issuer -dates -ext subjectAltName
openssl s_client -connect web01:443 -servername web01.example.com -showcerts </dev/null
openssl verify -CAfile chain.pem cert.pem
openssl pkcs12 -in bundle.pfx -nodes -out bundle.pem # PFX → PEM
openssl pkcs12 -export -inkey key.pem -in cert.pem -certfile chain.pem -out bundle.pfx
openssl rand -base64 32
OpenSSL 3.x moved legacy algorithms (RC4, MD4, old PKCS#12 encryption) to a legacy provider; old PFX files may need -legacy to open.
Limits and how it fails
Primary failure point. OpenSSL evidence is scoped to the exact command, inputs and verification options; reproduce with the real service/client before declaring success.
ReferenceConfiguration & state2 sections · depth on demand
Configuration, persistence and lifecycle
Distribution/platform context. OpenSSL owns inspection/test tooling; certificate/key/chain subtopics own the underlying objects and semantics.
Specialized lifecycle
Keep private keys protected and understand which application owns certificate/key paths and trust stores. When creating CSRs or inspecting material, preserve subject alternative names and key type requirements rather than relying on legacy CN assumptions. For live tests, set the intended SNI hostname and explicit CA/trust options where needed. Avoid weakening protocol/cipher verification just to obtain a successful handshake; use relaxed settings only as a bounded isolation test and restore the real policy for closure.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Certificates & TLS → OpenSSL. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://docs.openssl.org/ · confidence 94%Authoritative Linux project/vendor documentation reviewed for bounded reference claims: live TLS handshake inspection, SNI, chain presentation and verification options. Documentation-based technical verification only; not lab or production-runtime proof. The schema vendor_doc method is used for authoritative project/vendor documentation; deployment applicability remains separate evidence.
Basis: https://docs.openssl.org/3.6/man1/openssl-s_client/ · confidence 93%What changed and what may be affected
Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.
Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
OpenSSL operational reference
Topic-specific lookup boundaries, proof limits and next-step Evidence for OpenSSL.
| Lookup boundary | Topic-specific reference | Operational use |
|---|---|---|
| Scope / effective state | OpenSSL provides Linux cryptographic and TLS tooling for inspecting keys, CSRs, certificates, chains and live handshakes; its output must be interpreted in the context of the exact file, trust store, SNI and endpoint. | Establish exactly what this Topic owns before crossing into another subsystem. |
| Fast verification | Pin host + boot/time + real identity/workload → identify authoritative policy/key/trust source → read back loaded/effective runtime state → reproduce one safe allow/deny/handshake test → correlate audit/service/kernel evidence → locate first failed boundary → make the smallest persistent change → repeat original workload + regression/recovery check. | Use the shortest evidence path first; a fast check is a boundary test, not blanket proof. |
| Verification chain | input key/cert/CSR or endpoint → OpenSSL parser/crypto operation → verification options/trust/SNI → result → compare with service/client runtime | Trace requested/configured state through effective state to the observed workload result. |
| Failure boundary | OpenSSL evidence is scoped to the exact command, inputs and verification options; reproduce with the real service/client before declaring success. | Stop broad troubleshooting at the first boundary that is not supported by evidence. |
| Positive evidence | Correlated Linux security/trust evidence can establish this proof path: input key/cert/CSR or endpoint → OpenSSL parser/crypto operation → verification options/trust/SNI → result → compare with service/client runtime | Use this observation only for the specific claim it actually supports. |
| Evidence limit | It does not independently prove unobserved identities, objects, policies, namespaces, endpoints or time periods. OpenSSL evidence is scoped to the exact command, inputs and verification options; reproduce with the real service/client before declaring success. | Do not promote a local success signal into end-to-end or adjacent-dependency proof. |
| Next troubleshooting check | Continue from the first unproven security/trust boundary, capture the adjacent effective state and audit/handshake evidence, make only the demonstrated persistent change, then repeat the original workload plus recovery/regression checks. | Continue to the next unresolved boundary while preserving the original test condition. |
OpenSSL · operational reference
Compact Linux state, persistence, verification and boundary reference for fast lookup.
| Reference boundary | OpenSSL |
|---|---|
| Topic path | Certificates & TLS → OpenSSL |
| Runtime state | OpenSSL provides Linux cryptographic and TLS tooling for inspecting keys, CSRs, certificates, chains and live handshakes; its output must be interpreted in the context of the exact file, trust store, SNI and endpoint. |
| Fast checks | - Record exact host, distribution/kernel, boot ID, time window, workload, identity and the authoritative configuration/policy source for OpenSSL. - Read back the effective runtime state and precedence rather than assuming an edited file, package state or service status is active. - Reproduce one safe allowed/denied or handshake/access test and correlate kernel/service/audit evidence at the first relevant boundary. - Apply the smallest persistent cause-specific change, then repeat the original test plus an adjacent regression/recovery check. |
| Verification chain | input key/cert/CSR or endpoint → OpenSSL parser/crypto operation → verification options/trust/SNI → result → compare with service/client runtime Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary. |
| Failure boundary | OpenSSL evidence is scoped to the exact command, inputs and verification options; reproduce with the real service/client before declaring success. Boundary chain: process/context → userspace configuration → kernel subsystem/resource → device/network/filesystem dependency → effective state → original workload. |
| Persistence rule | Prove which configuration source owns the state, then prove that the running consumer loaded or generated the intended state. |
OpenSSL · specialized operational reference
Topic-specific Linux mechanics, lifecycle, proof path and failure-boundary lookup.
| Operational boundary | Topic-specific reference |
|---|---|
| Local artifacts | x509/pkey/verify inspect cert, key and trust path |
| Live handshake | s_client with exact host/port/SNI |
| Critical identity | SAN hostname + chain + trust store |
| Boundary | TLS proof stops before application authorization/content |