MYSYSAD · PKI Tools

🔐 OpenSSL CSR Builder

Commands for a private key and a CSR, or a self-signed certificate, with every name your server answers to. They update as you type and run in any shell.

🔑 ECDSA P-256

What to make

What to make

The CA signs the CSR and sends back the certificate. The private key never leaves your server.

Names the server answers to

The main name. It is added to the list below for you, because browsers check only that list.
One per line: host names, *.wildcards (one level) or IP addresses.

    Subject

    All optional. Most CAs fill these in from your account or leave them out; browsers never show them for a self-signed certificate.

    Legal name, as the CA has it.
    Most CAs no longer accept OU.
    Two-letter ISO code, such as US, GB, DE.
    Written out in full.

    Key and files

    ECDSA keys are smaller and faster, and every current CA takes them. Pick RSA 2048 only for very old clients or devices.
    Leave empty to name it after the first name.
    1 to 36500. Apple devices refuse more than 825.

    Good to know

    • Send the CA only the .csr file. The .key file stays on the server; anyone who has it can pose as your site.
    • The key is made readable only by you (mode 600), so there is no chmod step. Give the web server's user access to it, not everyone.
    • The key has no passphrase, so the web server can start on its own after a reboot. That is the usual choice for servers.
    • The commands run in any shell: sh, bash, dash and zsh. The settings go through a temporary file that is removed at the end.
    • Text is kept exactly as typed, including accents (Zürich), &, quotes, $ and backslashes.
    Share MySysAd

    ⚠️ IMPORTANT DISCLAIMER: The tools and scripts on this site are provided "AS IS" for educational purposes.

    Review destructive commands before executing. By using this site, you assume all risk and agree to our Full Terms of Service.

    Create a CSR or self-signed certificate with the right names

    Browsers check only a certificate’s Subject Alternative Names, not the Common Name, so a name missing from that list gets a name-mismatch error. Type the server’s names and pick a key type, and copy commands that make the key and a CSR, or a self-signed certificate, with every name included. The key is made on your own server, never here.

    Common questions

    How do I create a CSR with Subject Alternative Names?

    With OpenSSL 1.1.1 or newer: openssl req -new -newkey rsa:2048 -nodes -keyout example.key -out example.csr -subj "/CN=example.com" -addext "subjectAltName=DNS:example.com,DNS:www.example.com". Older versions need the SANs in a config file passed with -config.

    How do I make a self-signed certificate with SANs?

    With OpenSSL 1.1.1 or newer: openssl req -x509 -newkey rsa:2048 -nodes -keyout lab.key -out lab.crt -days 365 -subj "/CN=lab.test" -addext "subjectAltName=DNS:lab.test,IP:127.0.0.1". Browsers warn about it until it is trusted on each computer that connects, and Apple devices refuse one valid for more than 825 days.

    How do I check what’s inside a CSR?

    openssl req -in example.csr -noout -text shows the subject, key type and requested extensions; look for the Subject Alternative Name list. openssl req -in example.csr -noout -verify checks the CSR’s own signature.

    RSA or ECDSA?

    RSA 2048 works with every client. ECDSA P-256 gives smaller keys and faster TLS handshakes with the same security and is supported by all current browsers and servers. Some old clients and appliances only support RSA, so check before switching.

    What does -nodes mean?

    “No DES”: the private key is saved without a passphrase, so a web server can start without someone typing it. In OpenSSL 3 the option is called -noenc, and -nodes still works. Protect the key file instead: chmod 600 example.key.

    How do I check that a certificate matches my private key?

    Compare the public keys: openssl x509 -in cert.pem -noout -pubkey | openssl sha256 and openssl pkey -in example.key -pubout | openssl sha256 must print the same hash. The Certificate Converter checks this for you when you open both files.

    Related tools: Certificate Converter · PKI Inspector · SSL Checker · All tools A–Z