Back to Articles
Tutorial2026-09-25•4 min read•CSR.plus Team

How to Generate a CSR: OpenSSL, IIS, cPanel Step-by-Step

How to Generate a CSR: OpenSSL, IIS, cPanel Step-by-Step

How to Generate a CSR

A Certificate Signing Request (CSR) is the first step toward any TLS (still commonly called SSL) certificate: it bundles your public key and identity details, signed with your private key. The workflow is the same on every platform — generate a key pair locally, fill in your identity, and submit the CSR to your CA. Never send your private key to anyone, including your CA.

What a CSR is

A CSR is a file containing your public key and the identity you want certified — common name (the domain), organization, locality and country. It is signed with your private key so the CA can verify you control the key pair. Once the CA issues your certificate, the CSR itself is no longer needed.

Public key vs private key

Your private key is generated and kept on your server; the CSR and certificate carry only the public key. If the private key leaks, an attacker can impersonate your site, so never upload it through email, tickets, or a CA form.

Key algorithm: RSA vs ECDSA

RSA 2048 is the most broadly compatible default. ECDSA with a P-256 key offers security comparable to RSA 3072 at just 256 bits, with smaller certificates and handshakes (see RSA vs ECDSA). Pick based on your clients and CDN support.

Step 1: Choose an algorithm and generate the key pair

OpenSSL (Nginx/Apache/Linux): openssl req -new -newkey rsa:2048 -nodes -keyout domain.key -out domain.csr. The -nodes flag keeps the key unencrypted so the server can load it without a passphrase. For ECDSA, switch the algorithm to ec and specify the P-256 curve. Or use the CSR Generator to fill a form in your browser and download the key pair — no OpenSSL required.

Step 2: Fill in your identity

The Common Name must be the exact domain you are securing, e.g. www.example.com; for wildcard certificates use *.example.com. Fill organization, locality and country accurately. DV certificates validate only the domain; OV/EV also verify the organization.

Step 3: Submit on your platform

IIS: Server Certificates → Create Certificate Request, then complete the Distinguished Name fields. cPanel: Security → SSL/TLS → Generate, view, or delete SSL certificate signing requests. Windows certificate wizard / other panels: the same identity fields are collected and the request is written automatically.

Step 4: Hand the CSR to your CA and install

Submit the CSR text to your CA, complete validation, then download the issued certificate with its intermediate chain. After installing, use the SSL Checker to confirm the chain, expiry and hostname coverage, and the Certificate & Key Matcher to verify the certificate pairs with the private key you generated.

Troubleshooting

ProblemLikely causeFix
Private key lost or deletedSaved only once at generationRegenerate the CSR with the same key, or generate a new key pair and re-apply
CSR invalid / decode failedWhitespace copied in, or missing header/footerInclude the full -----BEGIN CERTIFICATE REQUEST----- and -----END CERTIFICATE REQUEST----- lines
Common Name mismatchCN set to a URL with http:// or a pathUse the bare domain, e.g. www.example.com; use SAN for extra names
CA rejects an old CSRSome CAs limit how long a CSR stays submittableRegenerate the CSR with the same key and resubmit
Browser shows incomplete chain after installMissing intermediate certificateInspect with the Certificate Decoder and add the intermediate
Config not applied after renewalWeb server not reloadedReload Nginx/Apache after installing the new certificate

Next steps

FAQ

Is the CSR the same as the private key?

No. The CSR contains only your public key and identity and is safe to send to a CA. The private key stays on your server and must never leave it.

What should the Common Name be?

The exact domain you are securing, without protocol or path — for example `www.example.com`. For wildcard certificates use `*.example.com`.

Can I reuse the same CSR?

Yes. As long as the key is unchanged you can use one CSR to apply to the same or different CAs. If a CA rejects an old CSR, regenerate it with the same key.

Free SSL/TLS tools

Verify and inspect your certificates in seconds.

Related Certificate Info

Learn more about choosing and buying certificates.

Related articles