How to debug or repair cURL errno 35

I am trying to make a cURL request in PHP on a URL. No matter what I try, I always get cURL errno 35 (for a specific URI). In the twist documentation, you can say:

You really want the error buffer to read the message there, as it identifies the problem a bit more. There may be certificates (file formats, paths, permissions), passwords, and others.

However, when you try to capture this information, nothing is returned.

$client = curl_init('https://dev.kelunik.com/css/all.min.css')

$log = fopen('/srv/www/Requestable/data/curl-log.txt', 'a+');

curl_setopt($client, CURLOPT_VERBOSE, 1);
curl_setopt($client, CURLOPT_STDERR, $log);
curl_setopt($client, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($client, CURLOPT_SSL_VERIFYHOST, 2)
curl_setopt($client, CURLOPT_CAINFO, __DIR__ . '/../../../../data/default.pem');
curl_setopt($client, CURLOPT_FAILONERROR, false);
curl_setopt($client, CURLOPT_RETURNTRANSFER, true);
curl_setopt($client, CURLOPT_HEADER, true);
curl_setopt($client, CURLINFO_HEADER_OUT, true);
curl_setopt($client, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($client, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($client, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);

if (!$response = curl_exec($client)) {
    throw new CurlException('Making request failed: ' . curl_error($client) . '(' . curl_errno($client) . ')');
}

fclose($log);

The above code always issues CurlExceptionwith errno 35, however the specific log file remains empty.

URI ( ) ™. CA, :

Mozilla, : Wed Sep 3 03:12:03 2014

, , ?

: URI ,

2: CA, .

OpenSSL:

Installed Packages
Name        : openssl
Arch        : x86_64
Version     : 1.0.1e
Release     : 30.el6_6.5

cURL:

curl 7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.16.2.3 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2
Protocols: tftp ftp telnet dict ldap ldaps http file https ftps scp sftp
Features: GSS-Negotiate IDN IPv6 Largefile NTLM SSL libz
+4
2

, dev.kelunik.com. ECDHE (ssllabs). . (ssllabs). OpenSSL ECDHE, cURL, , NSS, .

curl https://dev.kelunik.com

openssl s_client -connect dev.kelunik.com:443 -servername dev.kelunik.com 

. , SSL DHE/RSA. - ssllabs .

cURL OpenSSL . http://curl.haxx.se/docs/install.html.

+17

test.php php test.php, ( "done" ).

test.php( ). php Zend Engine v2.4.0 Ubuntu 12.04.

<?php>
$client = curl_init('https://dev.kelunik.com/css/all.min.css');
$log = fopen('/tmp/curl-log.txt', 'a+');

curl_setopt($client, CURLOPT_VERBOSE, 1);
curl_setopt($client, CURLOPT_STDERR, $log);
curl_setopt($client, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($client, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($client, CURLOPT_CAINFO, "/etc/ssl/certs/ssl-cert-snakeoil.pem");
curl_setopt($client, CURLOPT_FAILONERROR, false);
curl_setopt($client, CURLOPT_RETURNTRANSFER, true);
curl_setopt($client, CURLOPT_HEADER, true);
curl_setopt($client, CURLINFO_HEADER_OUT, true);
curl_setopt($client, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($client, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($client, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);

if (!$response = curl_exec($client)) {
    throw new CurlException('Making request failed: ' . curl_error($client) . '(' . curl_errno($client) . ')');
} else {
    echo "done!\n";
}

fclose($log);
?>
-1

All Articles