I've compiled php7.1.30 on ubuntu 14.04 successfully. When I test that peace of code
/ Get cURL resource
$curl = curl_init();
// Set some options - we are passing in a useragent too here
curl_setopt_array($curl, [
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => 'https://buy.itunes.apple.com',
CURLOPT_USERAGENT => 'Codular Sample cURL Request',
CURLOPT_POST => 1,
CURLOPT_POSTFIELDS => [
'item1' => 'value',
'item2' => 'value2'
]
]);
curl_setopt($curl, CURLOPT_VERBOSE, true);
// Send the request & save response to $resp
$resp = curl_exec($curl);
// Close request to clear up some resources
if (!$resp) {
echo('Error: "' . curl_error($curl) . '" - Code: ' . curl_errno($curl));
echo "\n";
}
curl_close($curl);
I got error Error: "gnutls_handshake() failed: Illegal parameter" - Code: 35
The verbose output is that:
Rebuilt URL to: https://buy.itunes.apple.com/
* Hostname was NOT found in DNS cache
* Trying 17.173.66.180...
* Connected to buy.itunes.apple.com (17.173.66.180) port 443 (#0)
* found 148 certificates in /etc/ssl/certs/ca-certificates.crt
* gnutls_handshake() failed: Illegal parameter
* Closing connection 0
From time to time this works successfully it seems that apple TLS support is not consistent.
However if I build the same code on Ubuntu 18.04 it works 100% and if I run the same code with php 5.5.9 (dist version) again 100% working.
So far I plan to upgrade to ubuntu 18.04 in order to get the working because I fail to overcome above issue. I've tried different /etc/ssl/cert ca files but unsuccessfully.
Help is appreciated.