簡體   English   中英

SoapClient:無法連接到主機

[英]SoapClient : Could not connect to host

我嘗試將SoapClient與cafile,local_cert和local_pk一起使用

function __construct($wsdl,$pem,$key,$cert){
    $context = stream_context_create(
        array(
            "ssl" => array(
                'verify_peer'      => false,
                'verifyhost '      => false,
                "cafile"           => $cert,
                'local_cert'       => $pem,
                'local_pk'         => $key
            )
        )
    );

    $this->client = new SoapClient($wsdl, array('soap_version'    => SOAP_1_2,
                                                'local_cert'      => $pem,
                                                'trace'           => true,
                                                'context'  => $context
                                               ));
}

但我遇到此錯誤: 無法連接到主機

我的wsdl是一種文檔樣式,他使用文字。

當我拋棄肥皂對象時:

object(SoapClient)[19]
  public 'trace' => int 1
  ``public _stream_context' => resource(38, stream-context)
  public '_soap_version' => int 2
  public 'sdl' => resource(39, SOAP SDL)
$context = stream_context_create(
        array(
            "ssl" => array(
                'verify_peer' => true,
                'allow_self_signed' => true,
                "cafile"           => $cert,
                'local_cert'       => $pem,
                'local_pk'         => $key
            )
        )

其工作C:

暫無
暫無

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

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