What does this generator make?
It makes two things that anyone who runs a web server, a test environment or a private network needs from time to time. One is a certificate signing request (CSR): a file that asks a certificate authority (CA) to issue a certificate for a key and a name. The other is a self-signed certificate: an X.509 certificate that you sign yourself with the key it belongs to. Both are created in your browser, in PEM format, and both can use a new key (ECDSA P-256 or P-384, Ed25519 or RSA) or a private key you already have.
A self-signed certificate is useful for local development, internal services, tests, mutual TLS between your own machines, and for learning how certificates work. It is not useful for the public internet. Browsers trust a certificate only when a CA they know has signed it, so a self-signed one shows a warning until you add it as trusted on that device. For a public site, make the CSR here, send it to a CA, and keep the private key on your server.
The details that matter are the subject alternative names (SAN). Modern browsers ignore the common name and read the names from the SAN list, which can hold host names (also with a wildcard such as *.example.test), IP addresses, e-mails and URLs. The page also sets the validity in days, a flag that says the certificate may sign other certificates (CA), and the key usage: web server, client login, or both. The hash can be chosen where the key type allows it.
The private key is created on your device and never leaves it. The page shows it so you can save it, in plain, unencrypted PEM, so protect the file. To read the result back and check every field, use the certificate decoder. If you only need a key, see the RSA key pair generator or the SSH key generator.
How to make a certificate or a CSR
- In What to make, choose Self-signed certificate or Certificate request (CSR).
- In Key:, choose Make a new key and pick Key type: (ECDSA P-256 is a good default; use RSA if an old system needs it), or choose Use my private key and paste it in Private key (PEM or OpenSSH):. If it is encrypted, fill in Key passphrase (if encrypted):.
- Under Who the certificate is for, fill in Common name (CN): and, if you want, organization, unit, country, state, city and e-mail. The country is two letters, such as BR or US.
- In Alternative names (SAN), one per line: list every name the certificate must answer to. Put the main host name here too.
- Set Valid for (days):. Keep it short for real use. Browsers refuse very long public certificates, but a private test certificate can last longer.
- Tick Can sign other certificates (CA) only if you are building a private CA. Choose For web servers and For client login as needed, and the Hash:.
- Click Copy PEM or Download the file. Save the key too, from Private key (keep it secret).
- Use the command shown under Inspect it with: to read the result.
Examples
A certificate for a local server
Common name localhost, alternative names localhost, 127.0.0.1 and ::1, key ECDSA P-256, 365 days, For web servers on. The page gives you a certificate and a key. Point your server to both:
ssl_certificate /etc/ssl/local/cert.pem;
ssl_certificate_key /etc/ssl/local/key.pem;Then add the certificate to your system or browser trust store so the warning goes away. Only do that on your own machine.
A CSR for a public site
Choose Certificate request (CSR), common name www.example.com, alternative names example.com and www.example.com, and a new RSA key. Send only the CSR to the CA. The CA never needs your private key. When the CA returns the signed certificate, pair it with the key you saved. Check the request with:
openssl req -in request.csr -noout -textA small private CA
Make a certificate with Can sign other certificates (CA) on, a long validity, and keep its key offline. The certificate will carry the basic constraint CA:TRUE and the key usages for signing certificates and lists. Install it on the devices that must trust your internal services. Then issue other certificates from it with openssl, because this page signs only with the key of the certificate itself.
Common errors and how to fix them
- "Fill in at least the common name.": the common name is empty. Type a host name or a label.
- "The country is a two-letter code, such as BR or US.": use two letters, not the country name.
- "The e-mail does not look right.": check for the
@and a domain. - "The validity must be from 1 to {max} days.": type a positive number within the limit.
- ""{name}" is not a host name, an IP address, an e-mail or a URL.": one SAN line is malformed. Remove spaces and symbols, and put one name per line.
- "This key has no private part: a certificate needs the private key to sign.": you pasted a public key. Paste the private one.
- The browser still says the site is not secure: the certificate is self-signed or the name is missing from the SAN. Add the exact host name and trust the certificate locally.
- Ed25519 is rejected: not every browser or server accepts it yet. Use ECDSA P-256 or RSA.
Frequently asked questions
Is a self-signed certificate secure?
The encryption is as strong as any other, if the key is strong. What it lacks is a third party vouching for the name. That is why it fits private use and tests, and not the public internet.
Where is my private key stored?
It is made in your browser and shown on the page. Nothing is sent or saved by the page. Copy it to a safe place before you close the tab, because it cannot be recovered afterwards, and treat the file like a password.
ECDSA, Ed25519 or RSA?
ECDSA P-256 is small, fast and accepted nearly everywhere. RSA works with very old software. Ed25519 is modern but still rejected by some browsers and tools. When in doubt, take P-256.
Why does my certificate need a SAN if it already has a common name?
Browsers check the SAN and ignore the common name. A certificate with only a common name fails with a name mismatch error. Repeat the host name in the SAN list.
The same thing with openssl
Bash
# Self-signed certificate with a new P-256 key and a SAN
openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:P-256 -nodes \
-keyout key.pem -out cert.pem -days 365 \
-subj "/CN=localhost" -addext "subjectAltName=DNS:localhost,IP:127.0.0.1"
# A CSR for an existing key
openssl req -new -key key.pem -out request.csr -subj "/CN=www.example.com" \
-addext "subjectAltName=DNS:www.example.com,DNS:example.com"
# Read it back
openssl x509 -in cert.pem -noout -text