Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hello, I tried curl to connect to a page TransUnion that requires a certificate but get the following
Error 7: couldn't connect to host
Is the host denying the certificate? Does the certificate reside on the the machine I am sitting on or the machine or server the script is running on?
Any help would be appreciated.
Damon Doran
I used the following just to establish a connection:Code: Select all
error_reporting(E_ALL);
// CONNECTION VARS
$_apiURL = "test.TransUnionNetAccess.com:3018";
$_cert = "/pathonserver/TUNA3.pem";
$_user = "jmcclesi1.midsouth.rr.com";
$_pwd = "CARBONIFEROUS";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$_apiURL);
curl_setopt($ch, CURLOPT_SSLCERT, $_cert);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, "$request");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSLCERTPASSWD,$_pwd);
// the three curl settings below are for GoDaddy hosted accounts:
// curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, TRUE);
// curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
// curl_setopt($ch, CURLOPT_PROXY, "http://64.202.165.130:3128");
$xmlResponse = curl_exec($ch);
printf("Error %s: %s", curl_errno($ch), curl_error($ch));feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]