How to fix curl error: "failed: Bad file descriptor"

How to fix an unexplained failure with the curl command: curl -v https://github.com * Trying 140.82.121.4:443... * connect to 140.82.121.4 port 443 failed: Bad file descriptor * Failed to connect to github.com port 443 after 24068 ms: Bad file descriptor * Closing connection 0