curl errno 35(连接到 [安全站点]:443 的未知 SSL 协议错误) [英] curl errno 35 (Unknown SSL protocol error in connection to [secure site]:443)
问题描述
我正在尝试使用 curl 发布到外部 url,外部页面使用 https,这是我正在使用的服务器的说明
i'm trying to make post to an external url using curl, the externa page use https, here is the desc of the server i'm using
服务器 Apache/2.2.11 (Win32) mod_ssl/2.2.11 OpenSSL/0.9.8k PHP/5.3.0
Server Apache/2.2.11 (Win32) mod_ssl/2.2.11 OpenSSL/0.9.8k PHP/5.3.0
外部 url 重定向到我在帖子中发送的另一个 url,但每次我尝试时都会收到此错误
the external url make a redirect to another url that i send in the post, but everytime i try i get this error
curl_errno=35(连接到 [安全站点]:443 时出现未知的 SSL 协议错误)
curl_errno=35 (Unknown SSL protocol error in connection to [secure site]:443)
所以我检查了萤火虫的响应,它说
so i check the firebug for the response and it say
无法加载源:http://localhost/3Party/PHP_VPC_3Party_Auth_Capture_Order_DO.php
这是我正在使用的代码
ob_start();
// initialise Client URL object
$ch = curl_init();
// set the URL of the VPC
curl_setopt ($ch, CURLOPT_URL, $vpcURL);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $this->postData);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_exec ($ch);
if (curl_error($ch)) {
$this->errorMessage =
"curl_errno=". curl_errno($ch) . " (" . curl_error($ch) . ")";
}
curl_close ($ch);
推荐答案
处理这个问题几周后,我至少能够建立连接,我不知道这是否是真正的答案,但它有效对我来说,我只是在上面的例子中添加了使用代理的选项,就像这样
After a few weeks dealing with this issue, i was able to at least establish the connection, i don't know if it is the real answer but it works for me, i just added to the example above, the options to use proxy, just like this
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_NTLM );
curl_setopt($ch, CURLOPT_PROXY, 'my.proxy');
curl_setopt($ch, CURLOPT_PROXYPORT, 'my.port');
curl_setopt($ch, CURLOPT_PROXYUSERPWD, 'domainuser:password');
希望能帮到你
这篇关于curl errno 35(连接到 [安全站点]:443 的未知 SSL 协议错误)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!