Curl in PHP, SSLV3 works in bash but not in libcurl

馋奶兔 提交于 2019-12-12 01:09:14

问题


This command works directly in bash:

curl --sslv3 -k 'https://www.test_site.com/test/abc.do'

It does not work in bash without both --sslv3 and -k

I've been trying to replicate in PHP with the following code but I get no response at all. Not even an error. Would appreciate any advice.

$curl = curl_init();

curl_setopt($curl, CURLOPT_URL,"https://www.test_site.com/test/abc.do");
curl_setopt($curl,CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSLVERSION, 3);

$result = curl_exec ($curl);
curl_close ($curl);

print $result;

回答1:


nevermind. Typo on my part. Works fine with both the ssl and other command.



来源:https://stackoverflow.com/questions/20183083/curl-in-php-sslv3-works-in-bash-but-not-in-libcurl

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