【发布时间】:2015-10-16 13:08:08
【问题描述】:
如何通过代理服务器进行 HTTPS 请求
代理服务器是 debian 上的tinyproxy
代码
$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
【问题讨论】: