Generate X.509 certificates with SAN support for development and testing
Your certificate will appear here
Fill in the form and click GenerateGenerating certificate...
privatekey.key -out certificate.crtprivatekey.key -out certificate.crtkey.pem -out cert.pem \certificate.crt -text -nooutEvery coffee helps keep the servers running. Every book sale funds the next tool I'm dreaming up. You're not just supporting a site — you're helping me build what developers actually need.
A self-signed certificate is a public-key certificate whose digital signature is verified by the public key contained within the certificate itself. Unlike CA-signed certificates, self-signed certificates are signed with their own private key rather than a trusted Certificate Authority.
In the PKI (Public Key Infrastructure) trust model, certificates are normally signed by a Certificate Authority (CA) that vouches for the identity of the certificate holder. With self-signed certificates, you are essentially saying "trust me, I am who I say I am" without third-party verification. This makes them unsuitable for public trust but perfectly valid for controlled environments.
The browser trusts the Root CA (pre-installed in the trust store), which trusts the Intermediate CA, which signed your certificate. This creates a verifiable chain of trust.
No chain of trust exists. The certificate signed itself. Browsers show warnings because they cannot verify identity through a trusted third party.
Every X.509 certificate contains these essential fields:
| Field | Description | Example |
|---|---|---|
| Subject (DN) | Distinguished Name identifying the certificate owner | CN=example.com, O=My Corp, C=US |
| Issuer (DN) | Who signed the certificate (same as Subject for self-signed) | CN=example.com, O=My Corp, C=US |
| Serial Number | Unique identifier assigned by the issuer | 0x7A3B2C1D |
| Validity Period | Not Before and Not After timestamps | 2024-01-01 to 2025-01-01 |
| Public Key | The public key and algorithm (RSA, ECDSA, etc.) | RSA 2048-bit |
| Signature | Digital signature from the issuer | SHA256withRSA |
| Extensions (v3) | Additional attributes like SAN, Key Usage | subjectAltName: DNS:*.example.com |
The current standard, introduced in 1996. Required for modern TLS.
Original versions with limited functionality.
The SAN extension is critical for modern certificates. It allows a single certificate to secure multiple identities:
Important: Since 2017, browsers like Chrome ignore the Common Name (CN) field for hostname validation and only check SANs. Always include your primary hostname in both CN and SAN for maximum compatibility.
To avoid browser warnings, you can add your self-signed certificate to the system trust store:
sudo cp cert.crt /usr/local/share/ca-certificates/sudo update-ca-certificates| Error | Cause | Solution |
|---|---|---|
NET::ERR_CERT_AUTHORITY_INVALID |
Certificate not signed by trusted CA | Add to system trust store or click "Proceed anyway" |
NET::ERR_CERT_COMMON_NAME_INVALID |
Hostname doesn't match certificate CN/SAN | Regenerate with correct hostname in SAN |
NET::ERR_CERT_DATE_INVALID |
Certificate expired or not yet valid | Check system clock; regenerate if expired |
SSL_ERROR_BAD_CERT_DOMAIN |
Firefox: domain mismatch | Ensure domain is in SAN extension |