Iam trying to navigate under a proxy with authentication with fsockopen under a site with ssl certificate but it retus null or empty string if i do a var_dump on $data variable.I am ruing on xampp windows 10. I need instead of the empty string to see the site or a string. I don't get any other errors, no error_log, nothing. What could be the issue?
$ip = '37.48.125.203';
$port = 333;
$login = 'adrianb1890';
$passwd = 'adrianb1890';
$fp = fsockopen($ip,$port); // coect to proxy
$port_site = 80;
$ssl = true;
$url = 'https://www.checkprg.com';
$utl_without_http_s = str_replace('https://', '', $url);
$utl_without_http_s = str_replace('http://', '', $utl_without_http_s);
if ($ssl) {
$port_site = 443;
$fp = fsockopen('ssl://'. $utl_without_http_s, 443, $ero, $errstr, 30);
}
$request = "GET $url HTTP/1.1";
$request .= "Host: $url";
$request .= 'User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) ';
$request .= "Gecko/20021204";
$request .= 'Accept: text/xml,application/xml,application/xhtml+xml,';
$request .= 'text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,';
$request .= "image/jpeg,image/gif;q=0.2,text/css,*/*;q=0.1";
$request .= "Accept-Language: en-us, en;q=0.50";
$request .= "Accept-Encoding: gzip, deflate, compress;q=0.9";
$request .= "Accept-Charset: ISO-8859-1, utf-8;q=0.66, *;q=0.66";
$request .= "Keep-Alive: 300";
$request .= "Coection: keep-alive";
$request .= "Referer: http://www.bing.com";
$request .= "Cache-Control: max-age=0";
$request .= "Proxy-Authorization: Basic ".base64_encode("$login:$passwd") ."";
fputs($fp, $request);
$data="";
while (!feof($fp)) {
$data.=fgets($fp,64000);
}
fclose($fp);
echo $data;
echo str_pad('',4096)."n";
ob_flush();
flush();
