gpt4 book ai didi

使用 TLS 1.2 的 PHP SOAP 通信

转载 作者:塔克拉玛干 更新时间:2023-11-03 06:02:28 26 4
gpt4 key购买 nike

我们在我们的网站中集成了 UPS 网络服务。最近我们收到了 UPS 的提醒:

Effective January 26, 2016,the UPS test environment will require the TLS 1.2 security protocol, and willbe available for your system testing.

Effective May 31, 2016,UPS will require the TLS 1.2 security protocol in production. After that date,any communication requests submitted to UPS using older protocols (TLS 1.1 orearlier) will fail.

我的问题是:

有什么方法可以使用 TLS 与 PHP SOAP 通信吗?我已经用谷歌搜索了很多但还找不到任何解决方案。

请推荐

最佳答案

我也遇到了这个问题。这是我使用它来强制进行 TLS 通信的内容。

$mode = array(
'soap_version' => 'SOAP_1_1', // use soap 1.1 client
'trace' => 1,
'stream_context' => stream_context_create(
array(
'ssl' => array(
'crypto_method' => STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT,
)
)
)
);

// initialize soap client
$client = new SoapClient($this->wsdl, $mode);

我的 MAMP 开发环境总是有问题,其中包含一个不支持 TLS 1.2 的 openssl 版本。

关于使用 TLS 1.2 的 PHP SOAP 通信,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35887414/

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