gpt4 book ai didi

php - curl errno 35(连接到 [安全站点] :443) 时出现未知 SSL 协议(protocol)错误

转载 作者:太空宇宙 更新时间:2023-11-03 13:08:58 24 4
gpt4 key购买 nike

我正在尝试使用 curl 发布到外部 url,外部页面使用 https,这是我正在使用的服务器的 desc

服务器 Apache/2.2.11 (Win32) mod_ssl/2.2.11 OpenSSL/0.9.8k PHP/5.3.0

外部 url 重定向到我在帖子中发送的另一个 url,但每次我尝试都会收到此错误

curl_errno=35 (Unknown SSL protocol error in connection to [secure site]:443)

所以我检查 Firebug 的响应,它说

无法加载源: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);

最佳答案

我认为问题在于您正试图访问端口 443 上的“http”URL(而不是“https”)。

您也可以尝试手动设置 SSL 版本:

curl_setopt($ch, CURLOPT_SSLVERSION, 3);

将 3 替换为远程服务器使用的任何 SSL 版本。

关于php - curl errno 35(连接到 [安全站点] :443) 时出现未知 SSL 协议(protocol)错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4073404/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com