Bug #78311 [NEW]: SoapClient stream_context ignored
| From: | giftrac+php at gmail dot com | Date: | Wed, 17 Jul 2019 22:27:38 +0000 |
| Subject: | Bug #78311 [NEW]: SoapClient stream_context ignored | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-221849@lists.php.net to get a copy of this message | ||
From: giftrac+php at gmail dot com
Operating system: CentOS Linux 7
PHP version: 7.3.7
Package: HTTP related
Bug Type: Bug
Bug description:SoapClient stream_context ignored
Description:
------------
In PHP 5.6.40, a stream_context can be provided to a SoapClient, that
specifies that the ssl cert of the peer should not be verified. In PHP
7.3.7 the SoapClient appears to be ignoring the provided stream_context
and attempts to verify the peer's cert. Similarly, a capath and cafile
specified in a stream_context are used in PHP 5.6.40 to successfully
verify a peer; however, they appear to be ignored in PHP 7.3.7.
Test script:
---------------
$opts = [
'ssl' => [
'crypto_method' => STREAM_CRYPTO_METHOD_TLS_CLIENT,
'verify_peer' => false,
],
];
$stream_context = stream_context_create($opts);
$options = [
'stream_context' => $stream_context,
];
$client = new SoapClient("https://...?wsdl",
$options);
$client->SomeMethod();//executes OK in PHP 5.6, errors out in PHP 7.3.7
Expected result:
----------------
It is expected that the ssl options in the stream_context are adhered to
in PHP 7, including but not limited to: verify_peer, verify_peer_name,
allow_self_signed, capath, cafile.
Actual result:
--------------
It appears the ssl options in the stream_context are ignored as
evidenced by the SoapClient production a SoapFault exception detailing
that it is unable to load from the provided WSDL URL (or when operating
in location/uri mode, throwing an exception about being unable to import
schema).
PHP Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR:
Parsing WSDL: Couldn't load from 'https://...' :
failed to load external
entity "https://..."
--
Edit bug report at https://bugs.php.net/bug.php?id=78311&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=78311&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=78311&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=78311&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=78311&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=78311&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=78311&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=78311&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=78311&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=78311&r=support
Expected behavior: https://bugs.php.net/fix.php?id=78311&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=78311&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=78311&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=78311&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=78311&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=78311&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=78311&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=78311&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=78311&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=78311&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=78311&r=mysqlcfg