kevingarnett2000 Posted April 16, 2007 Share Posted April 16, 2007 Hi, I have compiled php with the following options for using curl --with-openssl=/usr/local/ssl --with-curl=/usr/local and I have compiled curl with --with-ssl=/usr/local/ssl For non https sites (see below), my codes works fine $c = curl_init(); curl_setopt($c, CURLOPT_URL, "http://www.google.com"); $result = curl_exec($c); // it works But when accessing https sites(see below), I got a "cannot connect to host" error vias the curl_error() call. $c = curl_init(); curl_setopt($c, CURLOPT_URL, "https://somebank.com"); curl_setopt($c, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($c, CURLOPT_SSL_VERIFYPEER, FALSE); $result = curl_exec($c); // returns false $error = curl_error(); // "connect connect to host" Whats wrong? eh Link to comment https://forums.phpfreaks.com/topic/47208-cannot-access-https-using-curl/ Share on other sites More sharing options...
btherl Posted April 16, 2007 Share Posted April 16, 2007 Does it work if you don't set VERIFYHOST? I would also verify that you can make the connection (such as running telnet somebank.com 443 and seeing if it connects). Link to comment https://forums.phpfreaks.com/topic/47208-cannot-access-https-using-curl/#findComment-230232 Share on other sites More sharing options...
kevingarnett2000 Posted April 16, 2007 Author Share Posted April 16, 2007 I have tried removing the VERIFYHOST and try again, it still doesnt work. And weird enough, I cannot even telnet the SSL site. Does the problem lies on my computer itself? And what are some of the solutions to it? Link to comment https://forums.phpfreaks.com/topic/47208-cannot-access-https-using-curl/#findComment-230248 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.