Self-Signed Certificate Generator — Create SSL Certificates for Testing

CodexFuse Team · 2026-10-13T22:17:30.727Z · 6 min read min read

Generate a self-signed certificate for your own testing: localhost, staging, and internal tools. Steps to install, trust, and fix common errors.

If you need a certificate for your own local test server, staging site, or internal tool, a self-signed certificate generator is the fastest way to get HTTPS working. It creates a certificate signed by its own private key, so you can encrypt traffic without waiting for a certificate authority.

Developers use self-signed certificates every day for local work, test labs, and internal dashboards where public trust is not required. The catch is that browsers show a warning, because no trusted authority has verified the site's identity. You can also do it with our self esteem test — free, no signup needed.

What Is a Self-Signed Certificate?

It is a digital certificate signed with its own private key instead of by a public certificate authority. It still encrypts traffic between the browser and the server, but browsers do not trust it by default because no independent authority has verified the server's identity.

  • Common Name or SANs: the domain names or IP addresses the certificate covers, such as localhost.
  • Public key: the key browsers use to start the encrypted session.
  • Issuer and subject: identical for a self-signed certificate, because the certificate signs itself.
  • Validity period: the dates between which the certificate is valid, typically 30 to 365 days.

Modern browsers ignore the Common Name field and read Subject Alternative Names instead. Always put your domain or IP address in the SAN field, or the browser will show a name-mismatch warning.

When Should You Use a Self-Signed Certificate?

Use one when you need HTTPS encryption quickly for a server that is not public, and you do not want to wait for a certificate authority or configure an ACME client. It produces a working certificate in under a minute for local development, staging, and internal tools.

  • Local development: testing HTTPS-only features, service workers, and secure cookies on localhost.
  • Staging and QA servers: reproducing production HTTPS behaviour before a release goes live.
  • Internal dashboards and admin panels: encrypting traffic for tools only employees reach over a VPN or office network.
  • IoT and home lab devices: securing web interfaces on routers, NAS boxes, printers, and smart-home hubs.

There is also a speed argument. A public certificate requires domain validation and renewal automation. For a server that will only live for an afternoon of testing, that setup is more work than the test itself.

How Do You Generate a Self-Signed Certificate?

Fill in a short form with the hostname, organisation details, key type, and validity period, then download the certificate and private key. The tool runs in the page, so nothing is uploaded and your private key never leaves your device.

  1. Open the Self-Signed Certificate Generator in your browser.
  2. Enter the hostname the certificate should cover, usually localhost, plus every extra name or IP as a SAN.
  3. Fill in the optional organisation details, such as team name and city.
  4. Choose RSA 2048-bit as the safe default, and set a validity of 90 to 365 days.
  5. Generate and download the certificate and key files, then keep the private key somewhere safe.

If you need the certificate to cover several names, add each one before you generate. A certificate for both localhost and 127.0.0.1 is common.

How Do You Install a Self-Signed Certificate?

Installing has two parts: configuring the server to present the certificate, and optionally telling your own devices to trust it. The first part makes HTTPS work. The second part removes the browser warning on machines you control. The steps below cover Nginx, Apache, and Node.js setups.

Nginx

Copy the certificate and key to your server, set ssl_certificate and ssl_certificate_key in the server block, add listen 443 ssl, test with nginx -t, then reload.

Apache

Copy the files where Apache can read them, enable the SSL module, set SSLCertificateFile and SSLCertificateKeyFile in the virtual host, then restart the service.

Node.js

Read the certificate and key with fs.readFileSync, pass them as key and cert to https.createServer, listen on a dev port such as 8443, and expect the trust warning on first visit.

For local work, you can add the certificate to your own trust store so your own browser stops warning you. Do this only for certificates you generated yourself.

When Should You Stop Using a Self-Signed Certificate?

Stop the moment real users, customers, or search engines need to reach the site. A public launch, a client demo on their network, or any page that collects personal data all require a publicly trusted certificate. If you are telling visitors to click through the warning, you have outgrown self-signed certificates.

Switching is straightforward. Replace the self-signed certificate with a CA-signed one, install it in the same place, and reload the server. The rest of your HTTPS setup, redirects, headers, and secure cookies, stays the same.

After switching, verify the live certificate with the SSL certificate checker.

Fictional example: a developer, Maya, demos a staging app to a client on the client's network. The warning confuses the client, so she swaps in a CA-signed certificate for the demo. Test tools flag common indicators only; they do not certify safety.

Keep your private key private. Anyone who holds it can impersonate your server. Never paste a private key into a chat tool or a public forum.

If you need a request for a CA-signed certificate, the CSR generator guide explains how to build a signing request. After launch, the security headers checker covers the headers that sit alongside your certificate.

Tired of Certificate Errors and Renewal Chaos?

Self-signed certificates suit testing, but your live site deserves fully managed HTTPS: certificates issued, installed, and renewed automatically, with security headers and monitoring handled for you, all on CodexFuse credits.

Get Started with CodexFuse

Can I Generate a Self-Signed Certificate Online Without OpenSSL?

Yes. A self-signed certificate generator online removes the command line entirely: fill in the Common Name (the domain or hostname, such as localhost or dev.example.com) plus optional organisation details, pick a validity between 1 and 825 days (365 by default), and click Generate. The tool creates a 2048-bit RSA key pair in your browser with SHA-256 signing and hands you a PEM certificate (certificate.crt) and its PEM private key (private.key) — ready to point Nginx, Apache or Node.js at. The private key is generated by your browser’s Web Crypto API and is never uploaded to any server. No sign-up, no OpenSSL install.

Stop Fighting Certificate Setup

Self-signed certificates are the right tool for testing. They are fast, free, and fully under your control.

Start by generating your test certificate with the free Self-Signed Certificate Generator. Then, when you are ready to launch, bring the live site to CodexFuse and let the platform handle HTTPS for you.

Frequently Asked Questions

Are self-signed certificates safe?

They are safe for encryption on servers you control, because traffic is encrypted as strongly as with a CA-signed certificate. They are not safe as proof of identity, because no authority has verified the server.

Why does my browser warn me about a self-signed certificate?

The browser warns you because it cannot find a trusted authority that vouches for the certificate. The warning is about identity, not encryption. On your own test server, you can click through it.

Can I use a self-signed certificate on a live website?

Technically yes, but you should not. Visitors will see a full-page security warning, most will leave, and the site will not be treated as secure. Live websites need a certificate from a trusted authority.

How long should a self-signed certificate last?

For active development, 90 days is a good default because it forces regular rotation and limits the damage if a key leaks. For a home-lab device you rarely touch, up to 365 days is acceptable.

Can a self-signed certificate cover multiple domains?

With the CodexFuse generator, no extra names are added: it issues one certificate for the Common Name you enter, with no Subject Alternative Name field. For several hostnames, generate one certificate per name. Also note that modern browsers (Chrome 58 and later) only accept Subject Alternative Names and ignore the Common Name field entirely, so for browser-based testing you may prefer a generator that writes SANs — the OpenSSL command and mkcert both do.

What files do I download from the self-signed certificate generator?

Two PEM files: certificate.crt (the certificate) and private.key (the private key). The certificate carries a 2048-bit RSA public key and a SHA-256 signature, is valid for 1 to 825 days (365 by default), and shows its exact validity window after generation. Both can be copied to the clipboard or downloaded directly.

Is my private key safe when I generate a certificate in a browser tool?

With the CodexFuse tool, yes: the key pair is created inside your browser tab by the Web Crypto API and is never sent to a server. Still, treat the private key as a secret — anyone who holds it can impersonate the certificate, so store it securely and never paste it into tickets, email or chat.

Featured on Twelve Tools Hunt for Tools Featured on LaunchBuff Launch Llama Tools Launch your MCP Top Web Development Companies in the US - OnToplist.com Designer Listings Listed on SeeWhatNewAI Featured on SubmitMySaas Featured on AI Agents Directory Product Wing SaaS Wheel Featured on Stremit Featured on Thank John We Are Founders SubmitMySaas ShinyLaunch SaaS Tools Dir Featured on SaasHunt Product List Dir Featured on ShowMeBestAI Listed on Best-AI.org Featured on SaaSCity Listed on LaunchPact CodexFuse Solution on goodSaaS Featured on IndieLaunch Featured on BestAIApps AI X Collection Featured on SemiLaunch Listed on AlterBase We Like Tools codexfuse.dev LaunchClash Featured on Next Launch