Knowledgebase

Find frequently asked questions and setup guides by searching or by browsing the categories.

What the Error Means

Chrome and other Chromium-based browsers show "This site can't provide a secure connection" with the code ERR_SSL_PROTOCOL_ERROR when the TLS handshake for an HTTPS page fails in a way the browser cannot name more precisely. The browser sent its greeting to port 443 and got back something that is not valid TLS, or the connection ended before the handshake finished. Firefox and Safari word it differently. A certificate that has expired or names another site gives a separate certificate warning, not this error.

If You See It on Someone Else's Site

  • Check your computer's clock: a date far off can break secure connections; let the system set the time automatically.
  • Try a private window: it starts without cached data and with most extensions turned off.
  • Try another network: a proxy, VPN, or security software that inspects HTTPS traffic can break the handshake. Turn it off for one test.
  • Tell the site owner if the error appears on every network and device.

Test the Handshake from a Terminal

curl -v https://example.com/
openssl s_client -connect example.com:443 -servername example.com </dev/null

curl prints each step of the handshake. A working openssl test shows the certificate chain, the negotiated protocol, and a verify return code; a failed one stops early with an error that points to one of the causes below.

Plain HTTP on Port 443

The most common server-side cause is a web server that answers on port 443 without TLS. The browser expects a TLS reply and receives an HTTP one. Ask for plain HTTP on that port:

curl -i http://example.com:443/

A correctly configured server answers with a 400 page saying plain HTTP was sent to an HTTPS port. If you get your normal page or a redirect instead, the port is not using TLS. In Nginx, the listen line is then missing ssl:

server {
    listen 443 ssl;
    server_name example.com;
    ssl_certificate     /etc/letsencrypt/live/example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
}

In Apache, a virtual host on port 443 needs SSLEngine on and mod_ssl loaded: sudo a2enmod ssl on Debian and Ubuntu, sudo dnf install mod_ssl on AlmaLinux and Rocky Linux. Also check which program holds the port with sudo ss -ltnp | grep ':443 '; an application server or a container can take it instead of the web server.

Protocol Versions

Current major browsers have removed TLS 1.0 and 1.1, so a server limited to those versions has no protocol in common with them. Depending on the case, the browser shows this error or ERR_SSL_VERSION_OR_CIPHER_MISMATCH. Allow TLS 1.2 and 1.3 in Nginx:

ssl_protocols TLSv1.2 TLSv1.3;

In Apache, in the SSL configuration or the virtual host:

SSLProtocol -all +TLSv1.2 +TLSv1.3

Keep your distribution's default cipher settings; a hand-cut cipher list often breaks handshakes. Test each version by adding -tls1_2 or -tls1_3 to the openssl command.

Certificate Files and the Chain

  • Use the full chain: point Nginx at fullchain.pem, not cert.pem, so clients also receive the intermediate certificate. A missing intermediate usually shows as a certificate warning in some clients rather than this error, but fix it while you are there.
  • Key and certificate must match: Nginx will not load a pair that does not belong together, and sudo nginx -t reports it.
  • Every host name needs HTTPS: a request for www.example.com that falls through to a default server block without a working certificate fails the handshake.

Sites Behind Cloudflare

When a DNS record is proxied, the visitor's TLS connection ends at the Cloudflare edge, so the browser does not talk TLS to your server at all. Cloudflare's documentation points at the edge and the visitor's network: an edge certificate that is not active yet, a subdomain two levels deep that the Universal certificate does not cover, a minimum TLS version the client does not support, or a network filter that breaks TLS 1.3. Problems between the edge and your server appear as Cloudflare error pages instead, such as error 525 for a failed handshake with the origin. With the record set to DNS only, the browser connects to your server directly and everything above applies. Once the origin has a valid certificate, set the SSL mode to Full (strict).

Confirm the Fix

sudo nginx -t && sudo systemctl reload nginx
curl -I https://example.com/

Test the configuration before you reload. curl should print a status line such as 200. If the browser now reports a redirect loop, see ERR_TOO_MANY_REDIRECTS; the codes themselves are listed in HTTP status codes explained.

Was this answer helpful?
Loading...