У меня возникает проблема при попытке прочитать URL-адрес HTTPS на моем веб-сайте.
Если я использую «http», проблем нет (с file_get_contents и curl), но когда я заменяю «http»по "https" эти методы не работают.
Я получаю некоторые ошибки:
failed to open stream: operation failed occured
Failed to enable crypto occured
SSL operation failed with code 1. OpenSSL Error messages: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
В моем браузере все методы работают: https://ssl10.ovh.net/~fyprbqhq/_perso/facebook.myclimb/test.php (дисплей должен отображаться«ОК»)
В phpinfo () я получил:
openssl
OpenSSL support enabled
OpenSSL Version OpenSSL 0.9.8c 05 Sep 2006
Если у вас есть идеи.
Спасибо за помощь.
(Ps: get_headers () в моем случае тоже не работает с https)
Дополнительная информация:
file_get_contents:
$data = file_get_contents("https://ssl10.ovh.net/~fyprbqhq/_perso/facebook.myclimb/test.php");
Завиток:
$curl_handle = curl_init();
curl_setopt($curl_handle, CURLOPT_URL, "http://ssl10.ovh.net/~fyprbqhq/_perso/facebook.myclimb/test.php");
curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT,2);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, false);
$data = curl_exec($curl_handle);
curl_close($curl_handle);