簡體   English   中英

PHP7 SoapClient verify_peer_name:SOAP錯誤:無法連接到主機

[英]PHP7 SoapClient verify_peer_name: SOAP Error: Could not connect to host

我的Paypal代碼未與選項verify_peer_name => true一起運行。 當我使用選項false嘗試相同的Soap Request時,它可以工作,對我來說似乎是PHP7錯誤? 這適用於PHP5.3。 我總是得到錯誤:

無法連接到主機

我已經在服務器上安裝了證書,而且還可以卷曲URL,而不會出現問題,只有SoapClient無法正常運行。

有人知道參數verify_peer_name的作用嗎?

$client = new SoapClient("https://xxx.paypal/the.wsdl",
    array(
        "trace" => 1,
        "location" => "https://xxx.paypal/the.wsdl",
        'exceptions' => 1,
        "stream_context" => stream_context_create(
            array(
                'ssl' => array(
                    'verify_peer'       => true,
                    'verify_peer_name'  => true,
                )
            )
        )
    ) 
);

我發現了關於verify_peer_name的信息。並檢查它是否可以幫助您:peer_name字符串

Peer name to be used. If this value is not set, then the name is guessed based on the hostname used when opening the stream.

verify_peer布爾值

Require verification of SSL certificate used.

Defaults to TRUE.

verify_peer_name布爾值

Require verification of peer name.

Defaults to TRUE.

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM