Hi,
I am searching how to solve a problem and I dont find it :(
I want to access a page from a script behind a proxy :
(my script) <-(a proxy with authentificatio n) <-(https serveur
with authentificatio n)
-----------------------------------------------------------------
I get this error :
PHP Warning: file_get_conten ts(): SSL: fatal protocol error in F:\Data
\Scripts-html\php-test-file_get_conten ts\HTTP_Proxy_a uth.php on line
33
Warning: file_get_conten ts(): SSL: fatal protocol error in F:\Data
\Scripts-html\php-test-file_get_conten ts\HTTP_Proxy_a uth.php on line
33
PHP Warning: file_get_conten ts(https://logs.ovh.net/xxx-xxxx.xxx/
logs-12-2007/): failed to open stream: Cannot connect to HTTPS server
through proxy
in F:\Data\Scripts-html\php-test-file_get_conten ts\HTTP_Proxy_a uth.php
on line 33
Warning: file_get_conten ts(https://logs.ovh.net/xxx-xxxx.xxx/
logs-12-2007/): failed to open stream: Cannot connect to HTTPS server
through proxy in F:
\Data\Scripts-html\php-test-file_get_conten ts\HTTP_Proxy_a uth.php on
line 33
(Error reporting is set to E_ALL)
-----------------------------------------------------------------
Here is my script :
<?php
error_reporting (E_ALL);
$authPage = base64_encode(" xxxxxxx:xxxxxxx xx");
$authProx = base64_encode(" xxxxxxxxxx:xxxx xxxxx");
$url = 'https://logs.ovh.net/xxx-xxxx.xxx/logs-12-2007/';
$header = "Accept: text/xml,application/xml,application/xhtml+xml,text/
html;q=0.9,text/plain;q=0.8,ima ge/png,*/*;q=0.5\r\n"
."Accept-Language: fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0 .3\r\n"
."Accept-Encoding: gzip,deflate\r\ n"
."Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 \r\n"
."Keep-Alive: 300\r\n"
."Proxy-Connection: keep-alive\r\n"
."Proxy-Authorization: Basic {$authProx}\r\n "
."Authorization : Basic {$authPage}";
$opts = array (
'proxy' ='tcp://xxxxx.xxx.xx.xx xx.fr:8080',
'request_fullur i' =true,
'method'=>'GET' ,
'header'=>$head er
);
var_dump($opts) ;
$ctx = stream_context_ create(array('h ttp'=>$opts,'ht tps'=>$opts));
echo file_get_conten ts($url,false,$ ctx);
?>
-----------------------------------------------------------------
If someone see where is the problem, it would be cool ;)
thx