开发者

cURL script works when run from one server but not another

开发者 https://www.devze.com 2023-04-09 17:07 出处:网络
I recently moved a cURL script from one server (Ubuntu) to another (Mac OS X). The script worked when run from 开发者_如何学Gothe Ubuntu server but it doesn\'t work on the OS X server. I get error 35

I recently moved a cURL script from one server (Ubuntu) to another (Mac OS X). The script worked when run from 开发者_如何学Gothe Ubuntu server but it doesn't work on the OS X server. I get error 35 and this:

error:14077417:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert illegal parameter

Any ideas?

Edit: Here's what's probably a really good clue. This doesn't work:

curl -v https://foo.com/OA_HTML/RF.jsp?function_id=123

But this does:

curl -v -sslv3 https://foo.com/OA_HTML/RF.jsp?function_id=123

Now I just need to know how to do the equivalent of the second command from within PHP.


Could be some php.ini setting or apache follow or openbasedir setting !


I know I'm late but the equivalent of

curl -v -sslv3 https://foo.com/OA_HTML/RF.jsp?function_id=123

is

$ch = curl_init();     
curl_setopt($ch, CURLOPT_SSLVERSION, 3); //set to force SSL3
curl_setopt($ch, CURLOPT_URL, "https://foo.com/OA_HTML/RF.jsp?function_id=123");
$result = curl_exec ($ch);  //execute the request


Most of the time CURL over SSL uses OpenSSL, more than likely either CURL or OpenSSL is not installed or enabled on the new server. Save a file on the server with:

<?php phpinfo(); ?>

and check if these are enabled


ADD

Either that or your SSL Certificates where not created on the machine you are trying to use them on. Each SSL certificate has specific information about each machine (if received from an online vendor)

0

精彩评论

暂无评论...
验证码 换一张
取 消