Search code examples
phpsoapsslcurlfirstdata

First Data Curl WSDL SSL Failure


I am integrating with FirstData wsdl. following the First Data Global Gateway Web Service API Integration Guide . $kslocation is path to .key file. $kslocation is the path to .pem file and all these paths are valid.

$ch = curl_init($wsdl);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: text/xml"));
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, "$userid:$password");
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSLCERT, $pemlocation);
curl_setopt($ch, CURLOPT_SSLKEY, $kslocation);
curl_setopt($ch, CURLOPT_SSLKEYPASSWD, $keyname);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
echo curl_error($ch)."\n";
curl_close($ch);

is giving me error.

SSL read: error:1409441B:SSL routines:SSL3_READ_BYTES:tlsv1
alert decrypt error, errno 0

Solution

  • The problem was I was using the test account url. I changed it to the live url and it worked.