Create a Self-Signed SSL Certificate for Localhost (2026)
A self signed certificate generator is the right tool for HTTPS on localhost and a wrong tool for a public site. You are not “getting a free SSL certificate” that Chrome will trust on the internet. You are issuing a cert you sign yourself, then teaching your machine to trust it. FlashKit’s SSL certificate generator does the issuance in this tab. What a certificate is, and why HTTPS matters for SEO, is already in SSL/TLS certificates explained — two sentences, then this page is hands-on.
Self-signed vs CA-issued vs Let’s Encrypt
- Self-signed: subject = issuer. No public CA. Browsers warn unless you pin the cert in a trust store you control.
- Public CA / Let’s Encrypt: an ACME client proves you control the hostname; browsers already trust that CA. Use this for anything on the public internet.
- Private CA: your company root, pushed by MDM. Still not this widget.
Let’s Encrypt will not issue for localhost (it is not a public DNS name you control). That is the entire reason a self-signed or mkcert local CA exists.
OpenSSL one-liner with -addext subjectAltName
Modern Chrome and Firefox match names from the subjectAltName extension (RFC 5280 §4.2.1.6), not from CN. Ran on 10 Nov 2026, OpenSSL 3.0.13:
openssl req -x509 -newkey rsa:2048 -keyout localhost.key -out localhost.crt -days 365 -nodes \
-subj "/CN=localhost/O=FlashKit Lab/C=IN" \
-addext "subjectAltName=DNS:localhost,IP:127.0.0.1"
openssl x509 -noout -ext subjectAltName -in localhost.crt printed:
X509v3 Subject Alternative Name:
DNS:localhost, IP Address:127.0.0.1
Validity on that run: Not Before Nov 10 13:22:19 2026 GMT, Not After Nov 10 13:22:19 2027 GMT. SHA-256 with RSA encryption, 2048-bit key. -addext needs OpenSSL ≥ 1.1.1. On older 1.0.2, write a tiny config with subjectAltName = DNS:localhost,IP:127.0.0.1 and pass -extensions.
Generate the same shape in this tab
RSA-2048, SHA-256, subject = issuer. For CN localhost the SAN is DNS:localhost plus IP:127.0.0.1.
Open the SSL certificate generatorOnline generation and the private-key caveat
FlashKit loads node-forge in the browser (loadForge(), no FlashKit CA API). It generates a 2048-bit RSA key, a random serial, SHA-256 signature, validity from the days field (default 365), and subject = issuer. CN, C, and O come from the form; ST, L, and OU are fixed placeholders “State”, “City”, “IT”. It then adds a subjectAltName extension: DNS for the hostname you typed, and when that host is localhost, also IP:127.0.0.1. That is what stops the name-mismatch interstitial on https://localhost after you trust the cert. The component does not POST the key. Still: never reuse a browser-generated key on a production hostname. Treat the download as lab material. Close the tab when you are done.
An alternative that installs a local CA into your OS trust store is mkcert. It also writes SAN for localhost. Use it when you are tired of clicking through OS dialogs for every new cert.
Trust store steps (macOS, Windows, Linux) and Node
- macOS: double-click the
.crt, add to login or System keychain, set to “Always Trust” for SSL. Chrome uses the OS store. - Windows:
certlm.mscor “Manage computer certificates” → Trusted Root Certification Authorities → Import. Current User vs Local Machine is the usual mix-up. - Linux / Firefox: Firefox has its own store (Settings → Certificates → Import). Chromium on Linux follows p11-kit / the NSS or the distro CA bundle depending on the build — if a trust click did nothing, check which store that browser actually reads.
- Node:
NODE_EXTRA_CA_CERTS=/path/to/localhost.crtfor a one-off. Do not disablerejectUnauthorizedglobally.
After trust, a leftover name mismatch means SAN still does not list the host you typed in the address bar (127.0.0.1 vs localhost are different names; the OpenSSL command above includes both).
PEM / CRT / PFX conversions
Apache often wants .crt + .key. IIS wants PFX. The SSL converter does those encodings in-tab with Forge. Conversion is not issuance. A PFX bundles the private key; do not convert production keys on a shared computer.
Without SAN, Chrome’s name-mismatch interstitial appears even if you click through the untrusted-issuer warning. RFC 5280 §4.2.1.6 defines subjectAltName; the CA/Browser Forum Baseline Requirements require SAN on publicly trusted certificates, and current Chrome/Firefox match names from SAN rather than CN. FlashKit now writes that extension so a CN of localhost carries DNS:localhost and IP:127.0.0.1. A CN of dev.test carries only DNS:dev.test — add OpenSSL -addext yourself if you also need 127.0.0.1 for that name. Validity defaults to 365 days from generation time; the OpenSSL lab cert above was Not Before Nov 10 13:22:19 2026 GMT / Not After Nov 10 13:22:19 2027 GMT.
mkcert (FiloSottile/mkcert on GitHub) installs a local CA into the OS trust store and then issues short-lived certs that browsers already trust on that machine. Use it when you issue many .test names. It is still not Let’s Encrypt. Let’s Encrypt’s ACME http-01 and dns-01 challenges require a public hostname you control; localhost fails both. Staging certificates from Let’s Encrypt’s staging environment are CA-issued but not in the public trust store — different from self-signed, still not for production checkout pages. Never put a browser-generated key in a production TLS stanza, a CI secret, or a git repo. Close the tab. Wipe the download on a shared laptop.
How to confirm FlashKit’s SAN after you generate: copy the PEM, run openssl x509 -noout -ext subjectAltName on a machine with OpenSSL, or inspect the cert in Chrome (the SAN pane lists DNS and IP). The generator’s country field is sliced to two letters and uppercased; ST/L/OU stay “State” / “City” / “IT” even if you wanted Mumbai. Serial is 01 plus 16 random bytes as hex. Signature is SHA-256 with RSA. There is no OCSP, no CRL, no keyUsage extension beyond what Forge defaults. Vite’s https: true plus a custom cert/key pair is the usual local wiring; nginx wants ssl_certificate and ssl_certificate_key. After trust, a remaining NET::ERR_CERT_COMMON_NAME_INVALID means the address bar host is not in SAN — typing https://127.0.0.1 against a cert that only has DNS:localhost is that bug, which is why the localhost path adds the IP.
A free SSL certificate generator in search results is usually Let’s Encrypt or a reseller. This page is not that. Public HTTPS on a real hostname is certbot, Caddy, or your load balancer’s ACME. Localhost HTTPS is OpenSSL, mkcert, or FlashKit’s in-tab Forge build. Mixing those two sentences is how people ship a self-signed cert to production and then ask why Chrome screams. The private key never leaves the tab on the FlashKit path; it also never becomes a public CA. Treat the PEM pair as lab waste after the spike.
OpenSSL remains the main method if you want a config file, extra DNS names, or a 4096-bit key. FlashKit is RSA-2048 only, one DNS name from the CN, plus 127.0.0.1 when that CN is localhost. For app.localhost or a LAN IP, use OpenSSL -addext with the names you actually type in the address bar. Then trust that one cert, not a folder of experiments. Generate ssl certificate, create ssl certificate, openssl self signed — three phrases, one rule: SAN must list the name in the address bar.
Convert PEM to PFX in the browser
Forge, local. Not a CA. Wipe the download on a shared machine.
Open the SSL converter