Knowledgebase

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

What the Error Means

A TCP reset is a packet that ends a connection at once, without the normal closing exchange. Firefox reports PR_CONNECT_RESET_ERROR when such a reset ends the connection, most often while it is being set up or during the TLS handshake, before any page is received. Chrome reports a similar case as ERR_CONNECTION_RESET; see ERR_CONNECTION_RESET.

What a Visitor Can Try

  • Security software: antivirus or firewall products that inspect HTTPS traffic can reset connections they do not like. Turn the HTTPS inspection off briefly to test.
  • Proxy or VPN: disconnect and test again.
  • Network filtering: office, school, and some public networks reset connections to sites they block. Try a mobile connection.
  • Extensions and cache: test in a private window.

If the site fails from several networks and devices, the cause is on the server side.

For the Owner: Who Is Affected?

Test from the server itself, then from an outside machine:

curl -v --resolve example.com:443:127.0.0.1 https://example.com/
curl -v https://example.com/

The --resolve option sends the request to 127.0.0.1 while keeping the real name, so the server sees the right name in the TLS handshake and the certificate is checked as usual.

If the local request works and the outside one is reset, something between the internet and the web server sends the reset. If only some visitors are affected, look at what they have in common: an address range, a country network, an old client.

A Firewall or Fail2ban Answering with Resets

A firewall rule can reject TCP with a reset, for example an iptables rule with --reject-with tcp-reset. Fail2ban's iptables and nftables actions reject with an ICMP message by default, which a browser reports as a refused connection, but a jail whose blocktype is set to a TCP reset produces this error on every attempt from a banned visitor. Check the bans and lift one if it was a mistake:

sudo fail2ban-client status
sudo fail2ban-client status nginx-limit-req
sudo fail2ban-client set nginx-limit-req unbanip 198.51.100.25

Replace the jail name with yours. Rate limits and connection limits in nftables or iptables deserve the same check. Setup is covered in how to install Fail2ban.

TLS Version or Cipher Mismatch

Some servers, load balancers, and filtering devices reset the connection instead of sending a TLS alert when they cannot agree on a protocol version or cipher with the client. Test each version on its own:

openssl s_client -connect example.com:443 -servername example.com -tls1_2
openssl s_client -connect example.com:443 -servername example.com -tls1_3

If one version is reset and the other works, compare with the protocol settings on the server. See openssl s_client.

A Crashing Service

A web server worker or an application that crashes while handling a connection leaves the kernel to reset it. Look for crashes and restarts:

sudo systemctl status nginx
sudo journalctl -u nginx --since "1 hour ago"
sudo dmesg | grep -i segfault

Find the Sender with tcpdump

A capture on the server shows whether the server sends the reset. Filter for one visitor's address and reset packets:

sudo tcpdump -ni any 'host 198.51.100.25 and tcp[tcpflags] & tcp-rst != 0'

Reset packets show an R in the flags field. If the server sends them, the cause is on the server: a firewall rule, a ban, or a crash. If the visitor sees resets but none leave the server, something on the path or on the visitor's side sends them. More filters are in the tcpdump command.

Confirm the Fix

Ask the visitor to reload, or repeat the outside curl test. A complete response with no reset in the capture means the cause is gone.

Was this answer helpful?
Loading...