Я пытаюсь подключиться к веб-сайту с помощью curl. На моей локальной машине я могу подключиться, но на сервере разработки это не работает.
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt( $ch, CURLOPT_TIMEOUT, 3 );
curl_setopt( $ch, CURLOPT_VERBOSE, true );
curl_setopt( $ch, CURLOPT_USE_SSL, true );
curl_setopt( $ch, CURLOPT_FRESH_CONNECT, true );
На моей локальной машине curl настроен для использования OpenSSL, а на машине для разработки curl использует NSS.
Вот вывод, который я получаю на машина развития
* About to connect() to www.zomato.com port 443 (#0)
* Trying 104.81.108.141...
* Connected to www.zomato.com (104.81.108.141) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none
* SSL connection using TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
* Server certificate:
* subject: CN=*.zomato.com,OU=Engineering,O=Zomato Media Private Limited,L=New Delhi,ST=Delhi,C=IN
* start date: May 04 00:00:00 2017 GMT
* expire date: Aug 03 23:59:59 2018 GMT
* common name: *.zomato.com
* issuer: CN=GeoTrust SSL CA - G3,O=GeoTrust Inc.,C=US
> GET /sk/slovakia HTTP/1.1
Host: www.zomato.com
Accept-Language: en,ro;q=0.8
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36
Accept-Encoding: gzip, deflate, br
* Operation timed out after 3000 milliseconds with 0 out of -1 bytes received
* Closing connection 0
И вот вывод, который я получаю на местная машина
* Trying 104.84.165.29...
* TCP_NODELAY set
* Connected to www.zomato.com (104.84.165.29) port 443 (#0)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: G:\cacert.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=IN; ST=Delhi; L=New Delhi; O=Zomato Media Private Limited; OU=Engineering; CN=*.zomato.com
* start date: May 4 00:00:00 2017 GMT
* expire date: Aug 3 23:59:59 2018 GMT
* subjectAltName: host "www.zomato.com" matched cert's "*.zomato.com"* issuer: C=US; O=GeoTrust Inc.; CN=GeoTrust SSL CA - G3
* SSL certificate verify ok.
> GET /sk/slovakia HTTP/1.1
Host: www.zomato.com
Accept-Language: en,ro;q=0.8
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36
Accept-Encoding: gzip, deflate, br
< HTTP/1.1 200 OK
Задача ещё не решена.
Других решений пока нет …