PHP Execution Curl times error Tip curl error:recv failure:connection Reset by peer solution _php Tips

Source: Internet
Author: User
Tags curl connection reset ssl certificate

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);

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.