php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76493 CURL cannot connect in 7.2.6, works in 7.1.x
Submitted: 2018-06-18 14:31 UTC Modified: 2019-03-26 17:41 UTC
Votes:5
Avg. Score:4.0 ± 1.5
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:1 (33.3%)
From: adrian dot burla at gmail dot com Assigned: mike (profile)
Status: Closed Package: cURL related
PHP Version: 7.2.6 OS: Windows
Private report: No CVE-ID: None
 [2018-06-18 14:31 UTC] adrian dot burla at gmail dot com
Description:
------------
Running the same script against the same server, CURL cannot connect to the server in 7.2.6 with curl error 35; it works in 7.0.x and 7.1.x. Trying to debug I disabled verifypeer and manually set SSL version to 4, still it does not work. I tested in a command prompt with curl ver 7.60 and it works flawlessly with the default options (I provided only the URL, no other parameters).

Debug in 7.2.6
*   Trying 192.44.xxx.xxx...
* TCP_NODELAY set
* Connected to xxxxxxx.xxxx.com (192.44.xxx.xxx) port 443 (#0)
* ALPN, offering http/1.1
* successfully set certificate verify locations:
  CAfile: C:\PHP\Certificates\cacert.pem
  CApath: C:\PHP\Certificates
* OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to wirekey.pg.com:443
* stopped the pause stream!
* Closing connection 0

Debug in 7.1.18
*   Trying 192.44.xxx.xxx...
* TCP_NODELAY set
* Connected to xxxxxxx.xxxxx.com (192.44.xxx.xxx) port 443 (#0)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
  CAfile: C:\PHP\Certificates\cacert.pem
  CApath: C:\PHP\Certificates
* SSL connection using TLSv1.0 / DES-CBC3-SHA
* ALPN, server did not agree to a protocol
* Server certificate:
*  subject: C=US; ST=Ohio; xxxxxxxxx; CN=xxxxxxx.xxxxx.com
*  start date: Oct  4 14:21:40 2017 GMT
*  expire date: Oct  4 14:51:39 2018 GMT
*  issuer: C=US; O=Entrust, Inc.; OU=See www.entrust.net/legal-terms; OU=(c) 2012 Entrust, Inc. - for authorized use only; CN=Entrust Certification Authority - L1K
*  SSL certificate verify ok.
> GET yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy HTTP/1.1
Host: xxxxxxx.xxxxx.com
Accept: */*

< HTTP/1.1 200 OK
< Date: Mon, 18 Jun 2018 14:14:59 GMT
< Server: Microsoft-IIS/6.0
< Content-Type: text/xml; charset=ISO-8859-1
* no chunk, no close, no size. Assume close to signal end
<
* Closing connection 0


Test script:
---------------
$curl = curl_init();
curl_setopt($curl, CURLOPT_VERBOSE,1);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); //has no impact on the result
//curl_setopt($curl, CURLOPT_CAPATH, 'C:\PHP\Certificates');
//curl_setopt($curl, CURLOPT_CAINFO, 'C:\PHP\Certificates\cacert.pem');
curl_setopt($curl, CURLOPT_SSLVERSION,4); //fix for PHP 7 and xxxxxxx.xxxxx.com
curl_setopt($curl, CURLOPT_TIMEOUT, 150);
$response = curl_exec($curl);


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-12-01 20:11 UTC] adrian dot burla at gmail dot com
The problem persisted up to 7.2.10, it no longer exists with 7.2.12. Not tested in 7.2.11.
 [2019-03-26 17:41 UTC] mike@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: mike
 [2020-05-08 08:10 UTC] sidrafarooq dot 89 at gmail dot com
I am facing the same issue with php 7.2.24, can you please guide for which php version this bug is resolved.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 22:01:28 2024 UTC