How to do HTTPS requests via proxy server
The proxy server is tinyproxy
on debian
$context = stream_context_create([
'http' => [
'proxy' => 'tcp://xx.xx.xx.xx:8888',
'request_fulluri' => true
]
]);
echo file_get_contents('https://www.google.com', false, $context);
Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol in C:\wamp\www\google\test.php on line 10
Warning: file_get_contents(https://www.google.com): failed to open stream: Cannot connect to HTTPS server through proxy in C:\wamp\www\google\test.php on line 10
The problem which causes your second warning can be fixed by changing 'http' in stream_context_create to 'https'