Solution to the error message CURL ERROR: Recv failure: Connection reset by peer when executing Curl in PHP_PHP Tutorial

WBOY
Release: 2016-07-13 10:26:16
Original
1855 people have browsed it

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);
Copy after login

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/824787.htmlTechArticleI recently encountered the error message CURL ERROR: Recv failure: Connection reset by peer when using curl. I will solve it now. The method is shared with everyone, I hope it will be helpful to everyone. We often use cu...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template