1. Home
  2. Developer
  3. Self-Signed Certificate Generator

Self-Signed Certificate Generator

Make a self-signed certificate for localhost or internal hosts, right in your browser.

Runs in your browser · No upload
For development and testing only. Browsers do not trust this certificate, so do not use it on a public service. Public sites need a certificate from a public CA such as Let’s Encrypt.
The key pair is generated with WebCrypto in this browser and the signing happens here too. The private key is never sent to a server and never leaves the browser. It does stay on screen and in downloaded files, so do not commit it to a repository.

Small and fast keys, supported by all current servers and browsers. Signed with SHA-256.

Usually the one domain you will visit, for example localhost or dev.example.test.
Separate with new lines or commas, up to 50. Modern browsers match the address against the SAN, not the CN. A wildcard such as *.example.com is allowed in the first label only.
days
1 to 3650 days. The start time is 5 minutes before now to allow for clock drift. Around 365 days is plenty for development.
Organization details (optional)
Two letters, e.g. KR, US

How to use

  1. Enter the address you will visit as the common name (CN). For local development the default localhost is fine.
  2. List every domain and IP the server will answer to under subject alternative names (SAN), one per line. Current browsers match the address against the SAN, not the CN, so this is the field that matters most.
  3. Pick a key type (ECDSA P-256 or RSA 2048) and a validity period, then press Generate certificate and private key.
  4. Download the certificate (.crt) and the private key (.key) and point your dev server at them: nginx, Apache, Node.js, Docker and so on.
  5. Check the contents, signature and fingerprint yourself with the openssl commands shown below the result.

For development and testing only

A self-signed certificate is one where the issuer and the subject are the same. No public certificate authority (CA) vouches for it, so browsers show a “not secure” warning. Do not use it on a public service. A site that outside visitors reach needs a certificate from a public CA such as Let’s Encrypt. What this tool produces is meant for your own machine, an internal test server, CI, or local HTTPS development.

The private key is generated by WebCrypto in this browser and the signing is finished here as well. It is not sent to a server and does not leave the browser. It does remain on screen and in any file you download, so keep it out of source control.

Options

Option What it does
ECDSA P-256 Signature algorithm ecdsa-with-SHA256. Small keys, generated instantly.
RSA 2048 Signature algorithm sha256WithRSAEncryption. Choose it when older equipment must accept the certificate.
SAN Accepts domain names (dev.example.test, *.example.test) and IPv4 or IPv6 addresses. A wildcard is allowed in the first label only.
CA certificate Adds CA:TRUE and keyCertSign. Turn it on only if you will use the certificate as a root that signs others.
Client authentication Adds clientAuth to the extended key usage. By default only serverAuth is present.

Key usage also depends on the key type. A normal certificate gets digitalSignature for ECDSA and digitalSignature, keyEncipherment for RSA. Marking it as a CA gives digitalSignature, keyCertSign, cRLSign.

What the certificate contains

  • X.509 version 3 with a 16-byte random positive serial number from a cryptographic random source.
  • Subject and issuer are the same name, written in the order C, ST, L, O, OU, CN. With country kr, organization Dev Org and CN localhost you get C=KR, O=Dev Org, CN=localhost.
  • The start time is 5 minutes before now to tolerate clock drift, and the end is the number of days you entered from now. A 365-day certificate expires exactly 365 days from the moment you generate it.
  • Subject and authority key identifiers are included as hashes of the public key. Dates in 2050 or later are encoded as GeneralizedTime.

Getting rid of the browser warning

The warning goes away once you add the certificate to a trust store yourself. On macOS use Keychain Access and set it to Always Trust, on Windows add it under Trusted Root Certification Authorities in certmgr.msc, and on Linux use update-ca-certificates. It is trusted only on the machine where you add it. Remove it when you no longer need it: if the private key of a trusted development certificate leaks, anyone can impersonate the names that machine trusts.

Frequently asked questions

Can I use a self-signed certificate for a real website?

It is not recommended. Visitors see a security warning and most will leave. For a public site use a free public certificate such as Let’s Encrypt.

My browser says the certificate name does not match.

The address you typed is not in the SAN. If you browse to https://192.168.0.10, put that IP in the SAN, and if you use https://dev.local, put that name in. Matching the CN alone is not enough.

Is the result the same as one made with openssl?

Yes. The output is a standard X.509 PEM, so openssl x509 -in file.crt -noout -text reads it directly. Certificates from this tool were checked with openssl, including signature verification and host name matching.

Is the private key sent to a server?

No. Key generation and signing run in the browser’s WebCrypto and there are no network requests. The key disappears when you close the page, so download it and store it safely if you need it.

How do I inspect the certificate or convert its format?

Use the SSL Certificate Viewer to see its contents and fingerprint, and the Certificate Converter to switch to formats such as DER or P7B. To confirm a certificate and key belong together, use the Certificate Key Matcher.

SSL Certificate Viewer | Certificate Key Matcher | Certificate Converter | RSA Key Generator | SSH Key Generator

What you enter and the keys you generate are processed only in your browser and never sent to a server.

Can't find the tool you need?

Tell us what you want to do. We build the most requested tools first.