Php SoapClient stream_context option

后端 未结 2 1620
南笙
南笙 2020-12-12 02:26

I want to use a third party\'s web service. To use the web service I need to connect with HTTPS. My problem is that for the development process I have a test api with an inv

2条回答
  •  醉话见心
    2020-12-12 02:39

    Maybe not the invalid Certificate is a Problem, more the SSLv2/3 Handshake; can you try manually specifing a Cipher like this:

    $stream_opts = array(
    //      'ssl'=>array('ciphers'=>"3DES" // also working
    //      further ciphers on http://www.openssl.org/docs/apps/ciphers.html
            'ssl'=>array('ciphers'=>"SHA1"
          )
    );
    
    $myStreamContext = stream_context_create($stream_opts);
    $soapOptions['stream_context'] = $stream_opts;
    $soapClient = new SoapAuthClient("https://...", $soapOptions);
    

    Good luck!

提交回复
热议问题