I'm trying to get a simple PHP cURL request to a REST API to work, but I'm getting this error no matter what I try:
error:14077410:SSL routines:func(119):reason(1040)
My PHP code is:
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://jsonplaceholder.typicode.com/users");
curl_setopt($ch, CURLOPT_FAILONERROR, true);
$response = curl_exec($ch);
echo $response;
if (curl_errno($ch)) {
$error_msg = curl_error($ch);
echo $error_msg;
}
curl_close($ch);
This works just fine on other servers, such as here on tehplayground.com
Here is some info from phpinfo()
on my server:
PHP Version 5.3.6
cURL support enabled
cURL Information 7.12.1
Age 2
Features
AsynchDNS No
Debug No
GSS-Negotiate Yes
IDN Yes
IPv6 Yes
Largefile Yes
NTLM Yes
SPNEGO No
SSL Yes
krb4 No
libz Yes
Protocols ftp, gopher, telnet, dict, ldap, http, file, https, ftps
Host i386-redhat-linux-gnu
SSL Version OpenSSL/0.9.7a
ZLib Version 1.2.1.2
Any idea what's wrong? (I cannot change the server I'm using.)