I recently encountered the error message CURL ERROR: Recv failure: Connection reset by peer when using curl. I am now sharing the solution with you. I hope it will be helpful to everyone.
We often use curl to access web sites. Web sites are currently mainly divided into two protocols: http and https. As we all know, https type websites use SSL protocol + http protocol, which is currently the most secure website protocol. Visit this When building a website, the SSL protocol will be used to verify the visitor's certificate and check whether it is safe.
The same process applies to accessing such websites through curl, but corresponding parameters need to be added to curl. Bypassing the verification of the SSL certificate, you can access normally, such as General reasons for this error This parameter is not added (as shown below).
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($c, CURLOPT_SSL_VERIFYHOST, false);