Use PHPSoapClient to process https services with self-built certificates

Source: Internet
Author: User
Using PHPSoapClient to process self-built certificate https service using PHP SoapClient to process authenticated https webservice is completely correct. However, if you encounter some problems when you do not authenticate https but use a self-built certificate for https, the error "cocould not connect to host." is generally reported.


One solution is to try SoapClient to ignore https ssl authentication and directly skip the authentication process and paste the code directly.

$ Context = stream_context_create (array ('SSL '=> array ('verify _ peer' => false, 'Allow _ self_signe' => true ),)); $ options ['stream _ context'] = $ context; $ client = new SoapClient ($ url, $ options );

Verify_peer: Specifies whether to verify ssl. the default value is true.

Allow_self_signed: whether to allow https services with self-built certificates. the default value is false.


Post official documents: http://php.net/manual/en/context.ssl.php

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.