Ciao a tutti, cerco di collegarmi via socket a una pagina sotto HTTPS , ma sembra che si colleghi sempre con HTTP e non HTTPS, infatti ottengo l'errore
HTTP/1.1 404 Not Found Date: Fri, 14 Oct 2005 12:23:47 GMT Server: Apache Content-Length: 280 Keep-Alive: timeout=15, max=100 Connection: Keep-Alive Content-Type: text/html; charset=iso-8859-1
Not Found
The requested URL /dir/pagina.cgi was not found on this server.
Apache Server at sito.com Port 80
Il codice che uso è questo:
codice:
$host='sito.com' ;
$target='/dir/pagina.cgi';
$port=80 ;
$timeout=60;
$protocol="HTTPS/1.0" ;
$br="\r\n" ;
$sk=fsockopen($host,$port,$errnum,$errstr,$timeout) ;
if(!is_resource($sk)){
exit("Connessione fallita: ".$errnum." ".$errstr) ;
}
else{
$headers="GET ".$target." ".$protocol.$br ;
$headers.='Authorization: Basic '.base64_encode('user:pass').$br;
$headers.="Accept: image/gif, image/x-xbitmap, image/jpeg".$br ;
$headers.="Accept-Language: italiano".$br ;
$headers.="Host: ".$host.$br ;
$headers.="Connection: Keep-Alive".$br ;
$headers.="User-Agent: Socket-PHP-browser 1.0".$br;
$headers.="Referer: http://www.miosito.com".$br.$br ;
fputs($sk,$headers) ;
$dati="" ;
while (!feof($sk)) {
$dati.= fgets ($sk,2048);
}
}
fclose($sk) ;
che cosa sbaglio? perchè la connessione via socket non avviene tramite HTTPS? Help!