0

Can't connect to one domain using PHP curl (shell command work fine).

$mid=111;
$browser[$mid]['connection'] = curl_init('https://www.pay-me.ru/');
if(empty($browser[$mid]['ua'])) $browser[$mid]['ua']="Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/16.0 Firefox/16.0";
curl_setopt($browser[$mid]['connection'], CURLOPT_RETURNTRANSFER, true);
curl_setopt($browser[$mid]['connection'], CURLOPT_SSL_VERIFYPEER, TRUE);
curl_setopt($browser[$mid]['connection'], CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($browser[$mid]['connection'], CURLOPT_CAINFO, "D:/ca-bundle.crt");
curl_setopt($browser[$mid]['connection'], CURLOPT_VERBOSE, true);
print_r(curl_exec($browser[$mid]['connection']));
var_dump(curl_errno($browser[$mid]['connection']));

the result:

int(35)
* About to connect() to www.pay-me.ru port 443 (#0)
*   Trying 193.232.116.16...
* Connected to www.pay-me.ru (193.232.116.16) port 443 (#0)
* successfully set certificate verify locations:
*   CAfile: D:/ca-bundle.crt
  CApath: none
* Unknown SSL protocol error in connection to www.pay-me.ru:443 
* Closing connection 0

Setting CURLOPT_SSL_VERIFYPEER to FALSE doesn't help either. All other https sites work fine. Any suggestions for this domain (www.pay-me.ru)?

user3742227
  • 375
  • 5
  • 12
  • `https://www.pay-me.ru/` - according to the [Calomel SSL Verficiation](https://addons.mozilla.org/en-US/firefox/addon/calomel-ssl-validation/) addon in my firefox the site uses [TLS v.1.2](https://en.wikipedia.org/wiki/Transport_Layer_Security#TLS_1.2). Your curl module might not support that -> `Unknown SSL protocol error`. see http://stackoverflow.com/questions/30145089/tls-1-2-not-working-in-curl – VolkerK Jan 09 '16 at 08:36
  • Thanks. Updating from PHP 5.4 to 5.5 fixed this problem. – user3742227 Jan 09 '16 at 14:48

0 Answers0