Recently in the use of curl encountered Curl Error:recv failure:connection reset by peer error prompts, is the solution to share with everyone, I hope to help.
We often use curl to visit the Web site, the Web site is currently divided into HTTP and https two kinds of protocols, the well-known HTTPS type of Web site is through the SSL protocol +http protocol, is currently the most secure Web site agreement, access to such sites, will take the SSL protocol, Verify the visitor's certificate and detect if it is safe.
This is also the process of accessing such a Web site through curl, but the curl needs to add the appropriate parameters to bypass SSL certificate validation before it can be accessed normally , such as the general reason for this error is not added (see below).
curl_setopt ($c, Curlopt_ssl_verifypeer, false);
curl_setopt ($c, Curlopt_ssl_verifyhost, false);