cURL: https through a proxy

南笙酒味 提交于 2019-12-04 17:59:16

I find testing with command-line curl a big help before moving to PHP/cURL.

For example, w/ command-line, unless you've configured certificates, you'll need -k switch. And to go through a proxy, it's the -x <proxyhost[:port]> switch.

I believe the -k equivalent is

curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);

I believe the -x equivalent is

curl_setopt($curl, CURLOPT_PROXY, '<proxyhost[:port]>');

DISCLAIMER: I have not tested any of this. If you give more information about what you've tried, it might be helpful.

Havenard

No problem since the proxy server supports the CONNECT method.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!