Home / Fix guides / Website security

How to replace a self-signed certificate with a trusted one

A self-signed certificate is one your server vouches for itself, so browsers do not trust it and show a warning. Replace it with a certificate from a public certificate authority (Let's Encrypt is free), install it with its full chain, and reload your web server.

A self-signed SSL certificate encrypts the connection, but nobody independent has confirmed who you are. Browsers only trust certificates issued by a certificate authority (CA) they already know, so visitors to your site see a full-page warning instead of your homepage. The fix is to get a certificate from a public CA and install it in place of the self-signed one. For most sites this takes under an hour and costs nothing.

What a self-signed certificate is and what people see

Every HTTPS certificate is signed by someone. Normally that is a CA such as Let's Encrypt, DigiCert or Sectigo. With a self-signed certificate, the server signs its own certificate, so the issuer and the owner are the same. This is common on freshly installed servers, test setups, some hosting defaults and routers or admin panels.

Visitors usually see one of these:

  • Chrome and Edge: "Your connection is not private" with the code NET::ERR_CERT_AUTHORITY_INVALID
  • Firefox: "Warning: Potential Security Risk Ahead" with a code such as SEC_ERROR_UNKNOWN_ISSUER or MOZILLA_PKIX_ERROR_SELF_SIGNED_CERT
  • Safari: "This Connection Is Not Private"

The visitor has to click through an advanced option to continue, and most will not.

Why it matters

Trust and sales. A browser warning on a shop, booking page or contact form tells people your site may be unsafe. Many will leave and not come back.

Security. The warning teaches visitors to click past certificate errors, which is exactly what an attacker relies on. Without a trusted issuer, a visitor cannot tell your server from someone intercepting the connection.

Search and traffic. Search engines prefer working HTTPS, and crawlers and other tools may fail to fetch pages behind an untrusted certificate. Email links, ads and integrations that call your site over HTTPS can also break.

See also what to do about a website not secure warning.

How to check if your site has it

There are three free ways.

  1. In the browser. Open your site and, if you get a warning, view the details. If you can get in, click the padlock or site information icon, then the certificate. If the Issued To and Issued By names are the same, it is self-signed.
  2. On the command line. If you have a terminal, run this (replace example.com with your domain):
openssl s_client -connect example.com:443 -servername example.com </dev/null 2>/dev/null | openssl x509 -noout -subject -issuer

If the subject and issuer lines match, the certificate is self-signed.

  1. An online checker. The free Qualys SSL Labs SSL Server Test reports the issuer and whether the chain is trusted.

Check www and the bare domain separately, plus any subdomains such as shop. or mail.. Each can have a different certificate.

How to fix it in general

The steps are the same on every platform.

  1. Confirm your domain points at the right server. CAs check that you control the domain, usually by placing a file on your site or asking for a DNS record. If DNS points elsewhere, validation fails.
  2. Get a certificate from a public CA. Let's Encrypt is free and renews automatically with a client such as Certbot. A paid certificate is fine too, but for a typical business site it adds no extra encryption strength.
  3. Install the certificate with its intermediate chain. Most tools give you a file usually named fullchain.pem. Using only the single certificate file can cause errors on some devices.
  4. Point the server at the new files and reload. Remove or replace the old self-signed paths so it is not still being served.
  5. Make sure HTTP goes to HTTPS. See HTTP not redirecting to HTTPS.

If the site is purely internal (a test server or office device), a self-signed certificate can be acceptable, or you can use your own internal CA and install it on company devices. For anything customers visit, use a public CA.

Common platforms

Exact menu names depend on your host, version and theme, so treat these as where to look.

  • cPanel: look for SSL/TLS Status and run AutoSSL for the domain. Many hosts also offer a certificate installer under SSL/TLS.
  • Plesk: open the domain, then SSL/TLS Certificates. The Let's Encrypt extension, if installed, can issue and renew a certificate there.
  • Cloudflare: proxied domains normally get a free edge certificate that visitors see. Your own server can still be self-signed, which only works in the Full mode. Install a trusted certificate on it, or a Cloudflare Origin CA certificate, and use Full (strict).
  • AWS: AWS Certificate Manager issues free public certificates for load balancers and CloudFront, but you cannot install them directly on an EC2 server. On a single EC2 instance, use Certbot or similar.
  • IIS: in IIS Manager, open Server Certificates, import or complete the request, then choose it in the site's Bindings for HTTPS. The win-acme client can automate Let's Encrypt.
  • nginx: set ssl_certificate to the full chain file and ssl_certificate_key to the private key. Run nginx -t, then reload nginx. certbot --nginx can do this for you.
  • Apache: set SSLCertificateFile and SSLCertificateKeyFile in the HTTPS virtual host. Run apachectl configtest, then reload. certbot --apache can automate it.

On managed WordPress or website builder hosting, you usually cannot touch the server. Look for an SSL or domain section in the dashboard, or ask support to issue a certificate.

How to confirm the fix worked

  • Open the site in a private window on a different device or network. There should be no warning and a normal padlock.
  • Rerun the openssl command above. The issuer should now be a CA, not your own domain.
  • Run the SSL Labs test and check that the chain is complete and the name matches both www and the bare domain.
  • Click through key pages. If images or scripts still load over http://, fix those mixed content links.

How to stop it coming back

Self-signed certificates usually return when a server is rebuilt, a staging config is copied to live, or automatic renewal quietly stops.

  • Use a client that renews automatically, and test it. With Certbot, certbot renew --dry-run checks renewal without changing anything.
  • Keep track of every hostname and subdomain, since each needs a valid certificate.
  • Do not copy test server settings, including certificate paths, to production.
  • Watch the expiry date. An expired certificate gives a similar warning, see SSL certificate expired.

SiteMonday checks this in week 10 (domain, SSL and email deliverability) and lists it in a ranked fix list. Fixing it is up to you or your developer.

When to ask for help

If your host controls the server and you cannot find an SSL option, contact support and ask for a trusted certificate for your domain. If you run your own server and validation keeps failing, the cause is almost always DNS pointing to the wrong address or a firewall blocking port 80 or 443.

Step by step for your platform

Questions

Is a self-signed certificate safe?

It encrypts traffic, but visitors cannot verify they are talking to your server, so browsers warn them. It is fine for private testing, not for a public website.

Do I have to pay for a trusted certificate?

No. Let's Encrypt issues free certificates that browsers trust, and many hosts install them for you. Paid certificates mainly add support or warranty options.

Why do I still see the warning after installing the new certificate?

The server may not have been reloaded, the old certificate may still be configured, or the intermediate chain is missing. Reload the server, check the file paths, and use the full chain file.

Can Cloudflare hide a self-signed certificate on my server?

Visitors will see Cloudflare's certificate, but the connection to your server is only properly verified in Full (strict) mode. For that, install a trusted or Cloudflare Origin CA certificate on your server.

How long does replacing a certificate take?

With a host that offers one-click SSL it can take a few minutes. On your own server it is often under an hour, plus a short wait if DNS needs changing.

Will replacing the certificate affect my search rankings?

It should help, because crawlers and visitors can reach your pages without a security error. Make sure HTTP redirects to HTTPS afterwards.

Related problems