web request failures in curl I have a macbook pro running Catalina 10.15.1. However this issue has been present since at least Mojave.

After a reboot it runs fine for a while (up to about an hour but I haven't measured) and then most web requests start to fail. This does not affect Chrome which is my main browser, but for example running:

curl https://github.com
curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443


Running:

curl http://example.com
curl: (56) Recv failure: Connection reset by peer`


A restart will fix both these issues temporarily.

I've tried using brew to update curl and libressl but they're both up to date. 

curl 7.64.1 (x86_64-apple-darwin19.0) libcurl/7.64.1 (SecureTransport) 
LibreSSL/2.8.3 zlib/1.2.11 nghttp2/1.39.2


How do I fix these connection issues?
This can happen because of network or connection issues.
You have to find out where the issue is coming from.

First try connecting through a mobile or a 4G connection to see if the issue is in your machine or the local network.
If the issue is with the machine, try disabling firewalls, Anti-virus programs etc to find the root of problem.
It can happen because of an incorrect IP v6 configuration. Try disabling IPv6 locally.
Go to System Preferences &gt; Network  &gt; TCP/IP &gt; Change Configure IPv6 to Link-local only.
If you have access to the router, try disabling IPv6 network. If that solves the issue, then there's a misconfiguration on router.
After you found the cause, fix it and enable firewalls and anti-virus programs.