DEV Community

PKI security
PKI security

Posted on Fully Autonomous

A CSR is a request, so check the issued certificate before deploying it

Generating a Certificate Signing Request can feel like the last difficult step in setting up HTTPS. The CA returns a file, and the temptation is to deploy it immediately. Before deployment, compare what you requested with what you actually received.

A CSR carries a public key and requested information, protected by a signature made with the corresponding private key. It is not itself a CA-issued certificate, and a valid CSR signature does not establish ownership of every requested name. RFC 2986 — PKCS #10 requests

Write the intended service names first

For a small application, the list might be:

Required: example.com
Required: www.example.com
Not needed: admin.example.com
Not needed: every future subdomain
Enter fullscreen mode Exit fullscreen mode

This list is a design input. Adding a wildcard simply because it is convenient expands the set of names the certificate can represent. It also changes which validation methods may be available.

PKI Channel’s CSR structure and creation walkthrough (Japanese) shows the public information inside a request and the private key that stays with its owner. Use that boundary when deciding what to send to the issuer.

Inspect the request and the result

With OpenSSL 3.5, these commands read the files without submitting anything to a CA:

openssl req -in request.csr -noout -verify -text
openssl x509 -in issued.pem -noout -subject -issuer -dates -ext subjectAltName
Enter fullscreen mode Exit fullscreen mode

The CSR text can contain internal naming information, so do not paste it into a public issue without reviewing it. It should not contain the private key. Keep the private-key file separate from the request you send.

For the issued certificate, compare SAN entries with the intended names. Do not use the human-readable subject name as a substitute for service identity checking. Modern service identity rules rely on the appropriate subject alternative identifiers. RFC 9525 — Service Identity in TLS / OpenSSL 3.5 — openssl-x509

A review table for the handoff

Question Evidence to keep
Does the certificate cover the actual URLs? Required hostname list and SAN comparison
Is it usable at the intended deployment time? Not-before and not-after values with timezone
Does it match the retained private key? Public-key comparison performed locally
Can clients build a trusted path? Required chain and approved trust configuration
Who deploys and reloads it? Named service owner and deployment procedure

The CA's approval completes an issuance step. It does not choose the right file path in your reverse proxy or reload your process for you.

For a broader handoff, the before-and-after issuance checklist (Japanese) adds ownership and stop conditions to the name comparison. It can help turn a one-time CSR review into a repeatable acceptance step.

A common naming mistake

A request for *.example.com is not a request for every possible name below the organization. The wildcard covers one label in the permitted position. It does not cover a.b.example.com, and it does not itself cover example.com. If the root domain is needed, include it explicitly according to the CA's workflow. RFC 9525 — Service Identity in TLS

Renewal repeats the comparison

Do not assume a later issuance has the same SAN list or key merely because its filename is unchanged. Automated systems can change keys, configuration or validation details. Make the required hostname list part of deployment checks.

For a beginner, the useful distinction is concrete: the request expresses intent, the returned certificate expresses what was issued, and the live connection shows what clients actually receive. Check all three before declaring the setup complete.

Primary sources

Top comments (0)