Glossary

Self-Signed Certificate

Last verified

Definition

Self-signed certificates are certificates signed with their own private key, so issuer and subject are identical and no CA vouches for them.

A self-signed certificate is created and signed by the same key pair it certifies. Every root certificate is technically self-signed, but the term usually means a server certificate an administrator made with a tool such as OpenSSL. Clients have no CA to check it against, so they reject it unless that exact certificate has been added to their trust store or accepted as an exception.

Why it matters

Self-signed certificates give the same encryption strength as CA-issued ones but no authentication: a client cannot tell your certificate from one an attacker generated. Browsers show errors such as MOZILLA_PKIX_ERROR_SELF_SIGNED_CERT or NET::ERR_CERT_AUTHORITY_INVALID, and command-line tools report "self-signed certificate in certificate chain". They remain useful for local development, lab equipment and quick tests. For anything shared across people or machines, a private CA scales better, and public sites can get free trusted certificates through ACME.

Example

openssl req -x509 -newkey rsa:2048 -nodes -days 30 \
  -keyout localhost.key -out localhost.crt \
  -subj "/CN=localhost" \
  -addext "subjectAltName=DNS:localhost,IP:127.0.0.1"

The SAN entry is essential, because browsers ignore the CN.

Common misconceptions

  • Self-signed means unencrypted or weakly encrypted. The encryption is identical; what is missing is proof of identity.
  • Clicking through the warning is harmless. It trains users to ignore warnings, an attacker's certificate produces the same warning, and sites using HSTS do not allow clicking through at all.
  • Self-signed certificates are free, so they suit public sites. Free CA-issued certificates are widely available; self-signed ones only make sense where you control every client.

See also