b2KIT

Self-Signed Certificate Generator

Generate self-signed X.509 certificates for development and testing. Configure validity period, key usage, and SANs.

Tested tool guide Tested browser tools Checked August 16, 2026

What Self-Signed Certificate Generator does and how it behaves

Fill in the subject name, validity period, key type, key usage, and the hostnames and IP addresses your server answers to, and this tool returns a certificate and its private key, self-signed and generated locally. Nothing is uploaded; the key pair exists only on your machine. The usual surprise is that the certificate is valid and the browser still refuses it: modern browsers match the hostname only against the subjectAltName extension and ignore the common name, so a certificate whose CN is right but whose SAN list omits the hostname always triggers an untrusted warning.

How the result is produced

1

What gets generated

The form fields map directly onto X.509 certificate fields: common name and organization become the subject, the validity period becomes the notBefore and notAfter dates, and the key usage choices become the matching extensions. A key pair is generated at the size you select, and the certificate is signed with its own private key, so issuer and subject are identical.

2

Hostname matching

When a client connects over TLS, it compares the hostname in the URL against the subjectAltName extension in the certificate; modern clients no longer fall back to the common name. DNS names must be listed as DNS entries and IP addresses as IP entries. A certificate that lacks a matching SAN entry is treated as untrusted even though it is cryptographically valid and correctly signed.

Good uses

  • Run a local dev server over HTTPS: generate a certificate for localhost, 127.0.0.1, or a machine hostname so secure-context features such as service workers, secure cookies, and camera or microphone access behave as they will in production.
  • Exercise mutual TLS: generate a certificate with clientAuth in its extended key usage and configure it as a client certificate to test mTLS authentication against a local server.
  • Build test fixtures for certificate-handling code: certificates with chosen SANs, key usages, and expiry dates feed into parsers and validators that check hostname, expiry, and usage rules, without waiting on a public CA.

Limits and checks

  • Generating a certificate does not make anything trust it. Browsers reject self-signed certificates by default, and the warning disappears only after you install the certificate as a trust anchor on each client machine, which is a system-wide change, not a per-site setting.
  • Hostname verification reads the subjectAltName extension and nothing else. A hostname you visit that is missing from the list, or an IP address typed in as a DNS name, keeps the warning alive no matter what you put in the common name field.
  • The private key is returned alongside the certificate, and anyone holding it can impersonate your server. Treat the key as a secret, never deploy this certificate to production where every visitor gets a warning, and note that self-signed certificates have no revocation mechanism.

Common questions

I generated a certificate for localhost, but the browser still shows an untrusted warning.

That is expected: generating a certificate does not make the browser trust it. Install the certificate into the trust store of the machine running the browser, and confirm that localhost and 127.0.0.1 both appear in the subjectAltName list. The warning persists until both are true.

Can I use this certificate on a production site?

No. Every visitor's browser would reject it unless you had already installed your certificate on each client machine, which is impractical and provides no real security. For a public site, obtain a certificate from a public CA that browsers trust by default; Let's Encrypt issues these free of charge.

References and verification

The behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools