我正在尝试使用CURL获取澳大利亚verison黄页主页的html代码,但是我遇到了一个CURL错误。
每次都会产生以下错误。
* Rebuilt URL to: https://www.yellowpages.com.au/
* Trying 104.94.32.193...
* TCP_NODELAY set
* Connected to www.yellowpages.com.au (104.94.32.193) port 443 (#0)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: D:\projects\my_site\webroot/cacert-2019-01-23.pem
CApath: none
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server accepted to use http/1.1
* Server certificate:
* subject: C=AU; ST=Victoria; L=Melbourne; O=Sensis Pty Ltd; OU=SSL Administration; OU=Unified Communications; CN=*.whitepages.com.au
* start date: Oct 4 00:00:00 2016 GMT
* expire date: Sep 5 23:59:59 2019 GMT
* subjectAltName: host "www.yellowpages.com.au" matched cert's "*.yellowpages.com.au"
* issuer: C=GB; ST=Greater Manchester; L=Salford; O=COMODO CA Limited; CN=COMODO RSA Organization Validation Secure Server CA
* SSL certificate verify ok.
> GET / HTTP/1.1
Host: www.yellowpages.com.au
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13
Accept: */*
Curl error: SSL read: error:00000000:lib(0):func(0):reason(0), errno 10054cURL error (56):
Failure when receiving data from the peer
$url = 'https://www.yellowpages.com.au';
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CAINFO, __DIR__ . "/cacert-2019-01-23.pem");
curl_setopt($ch, CURLOPT_TIMEOUT, 0); //Wait forever
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
//curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13');
$result = curl_exec($ch);
if($errno = curl_errno($ch)) {
echo 'Curl error: ' . curl_error($ch);
$error_message = curl_strerror($errno);
echo "cURL error ({$errno}):\n {$error_message}";