Back to the blog Seguridad web

How to Generate a CSR for an SSL Certificate

Generate a CSR with OpenSSL, include the required DNS names, and check the file before sending it to a certificate authority. Keep the private key protected.

Conceptual diagram of a CSR, a protected private key, and a TLS certificate issued by a certificate authority

What a CSR Is and What It Is For

A CSR (Certificate Signing Request) is a PKCS #10-formatted request submitted to a certificate authority (CA) when requesting a certificate. It includes information about the subject, a public key, and a signature generated with the corresponding private key.

A CSR is not the certificate, and generating one does not activate HTTPS or configure the server. The CA authenticates the requester and verifies the signature; if it accepts the request, it issues an X.509 certificate. The associated private key is kept protected and is not sent with the CSR.

Although people often say “SSL certificate,” in this context they usually mean a certificate used with TLS. The CSR is part of the certificate request process; it does not, by itself, configure which version of the TLS protocol the server will use.

What a CSR Is and What It Is For

Before You Generate One: Gather These Details

First, confirm with the CA or the provider managing the certificate which names and details must appear in the request, and what format it expects. Requirements may depend on the issuance process. Do not include DNS names based on assumptions: prepare a list of the names the certificate must cover and compare it with the instructions you received.

Confirm that you have the corresponding private key, or identify the approved procedure for creating one. If it does not exist yet, do not invent or reuse a key from another service without checking your organization’s or provider’s instructions.

Prepare the subject name and the DNS names you want to request. For alternative names, the OpenSSL configuration can declare subjectAltName and entries such as DNS.1 and DNS.2.

Decide where you will store the private key and the CSR. Keep the private key protected and separate from the file you will send to the CA.

Check with the provider what subject information it requires. Do not assume that the fields or names included in a request will be accepted: the CA performs its own checks.

Before You Generate One: Gather These Details

Generate the Request with OpenSSL

If you already have a private key, OpenSSL can generate a CSR from it. In the following command, the filenames are examples: replace them with the appropriate paths for your environment.

openssl req -new -key server.key -out server.csr -config csr.cnf

server.key represents the private key used to sign the request; server.csr is the generated file, and csr.cnf is the configuration file.

If you need alternative DNS names, check that the configuration includes subjectAltName and the corresponding DNS entries, such as DNS.1 and DNS.2. Use the exact names you confirmed with the CA or provider.

Do not paste the private key into request forms or send it to the CA. The file submitted is the CSR, unless a different legitimate provider procedure specifies otherwise.

What to Check in the Configuration

The csr.cnf file must follow the format and instructions from OpenSSL and the CA. The alternative names section may refer to a DNS names section with entries such as DNS.1 and DNS.2; avoid copying a generic configuration without checking which names it produces.

The names server.key, server.csr, and csr.cnf are illustrative placeholders, not required paths. Before running the command, confirm that the key exists and that you have permission to read it, and choose an appropriate output location for the CSR.

Verify the CSR Before Sending It

Check that the file can be read, displays the expected information, and has a verifiable signature. You can inspect it with OpenSSL as follows:

openssl req -in server.csr -text -verify -noout

Review the subject and alternative names shown in the output, and confirm they match the request you need. The -verify option checks the request’s self-signature; it does not confirm the requester’s identity or guarantee that the CA will issue the certificate.

If an error appears, do not send the file until you have checked the path, contents, and relationship between the CSR and the intended private key. If you cannot resolve the issue using your implementation’s documentation, consult the responsible administrator or provider.

Submit the Request and Complete the Installation

Submit the CSR file to the CA using the process it specifies. The CA performs its checks and decides whether to issue the certificate. A valid request does not guarantee issuance.

Once you receive the certificate, installation and server configuration are subsequent tasks. You must have the corresponding private key and follow the instructions for the platform or server that terminates the TLS connection. Keep these steps separate: a PKCS #10 request does not determine whether the server will use TLS 1.2, TLS 1.3, or another configuration. Protocol versions and server parameters are managed separately.

Administrator and Provider Responsibilities

As the administrator, confirm the requested names, protect the private key, and verify that the certificate you receive is installed on the correct system. The CA or provider manages the checks and issuance process according to its procedure; issuance does not replace the configuration and security decisions that are the service owner’s responsibility.

At AirBip, routing and TLS certificates are automated through Traefik and Let’s Encrypt. In this type of deployment, you may not need to generate a CSR manually for the usual workflow. Confirm the options that apply to your domain and service in the provider’s documentation or with its support team; do not assume that every deployment or custom requirement works the same way.

Frequently asked questions

What is the difference between a CSR and a certificate?

A CSR is a request containing subject information and a public key, and it is signed with the corresponding private key. The CA reviews the request and, if it accepts it, issues a certificate. The CSR is not the certificate installed on the server.

Should I send the private key along with the CSR?

No. Keep the private key protected; the file submitted to request the certificate is the CSR. Do not share the private key with the CA or include it in a form.

How do I add multiple DNS names to a CSR?

Configure the subjectAltName extension with DNS entries such as DNS.1 and DNS.2 in the OpenSSL configuration. Then check the CSR inspection output and confirm the names with the CA or provider.

Does creating a CSR activate HTTPS or the TLS protocol?

No. Creating a CSR only prepares the certificate request. The CA must complete its checks and issue the certificate; afterward, it must be installed and the server configured. The TLS version and parameters are managed separately.

Sources and further reading 4