2016-04-14 132 views
0

我的貝寶代碼沒有運行選項verify_peer_name => true。當我嘗試使用相同的SOAP請求並且選項爲false時,它看起來像是一個PHP7 Bug?這對我來說適用於PHP5.3。 我總是得到錯誤:PHP7 SoapClient verify_peer_name:SOAP錯誤:無法連接到主機

無法連接到主機

我已經安裝在服務器上的證書,我還能夠捲曲沒有問題的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, 
       ) 
      ) 
     ) 
    ) 
); 

回答

2

我發現了大約verify_peer_name並得到了這個..檢查是否可以幫助U: 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. 
+0

謝謝,但是verify_peer_name選項完全檢查什麼? – slaver113

+0

它需要驗證,如果您未驗證對等方意味着您使SSL連接不安全,因爲您不驗證其提供的信息。 – Aparna

+0

對不起,這是錯誤的。 verify_peer驗證證書和verify_peer_name做別的... – slaver113

相關問題