Skip to content

Commit 9491694

Browse files
committed
Deprecate SoapClient ssl_method option
Instead use ssl stream context options instead. The direct equivalent would be crypto_method, but min_proto_version / max_proto_version are recommended instead. Part of https://wiki.php.net/rfc/deprecations_php_8_1.
1 parent 882289e commit 9491694

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

UPGRADING

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,13 @@ PHP 8.1 UPGRADE NOTES
406406
. The PDO::FETCH_SERIALIZE mode has been deprecated.
407407
RFC: https://wiki.php.net/rfc/phase_out_serializable
408408

409+
- SOAP:
410+
. The ssl_method option for the SoapClient constructor has been deprecated in
411+
favor of ssl stream context options. The direct equivalent would be
412+
crypto_method, but min_proto_version/max_proto_version are recommended
413+
instead.
414+
RFC: https://wiki.php.net/rfc/deprecations_php_8_1
415+
409416
- Standard:
410417
. Calling key(), current(), next(), prev(), reset(), or end() on objects
411418
is deprecated. Instead cast the object to array first, or make use of

ext/soap/soap.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2127,6 +2127,9 @@ PHP_METHOD(SoapClient, __construct)
21272127
if ((tmp = zend_hash_str_find(ht, "ssl_method", sizeof("ssl_method")-1)) != NULL &&
21282128
Z_TYPE_P(tmp) == IS_LONG) {
21292129
add_property_long(this_ptr, "_ssl_method", Z_LVAL_P(tmp));
2130+
php_error_docref(NULL, E_DEPRECATED,
2131+
"The \"ssl_method\" option is deprecated. "
2132+
"Use \"ssl\" stream context options instead");
21302133
}
21312134
} else if (!wsdl) {
21322135
php_error_docref(NULL, E_ERROR, "'location' and 'uri' options are required in nonWSDL mode");
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
--TEST--
2+
ssl_method option is deprecated
3+
--EXTENSIONS--
4+
soap
5+
--FILE--
6+
<?php
7+
8+
new SoapClient(null, [
9+
'location' => 'foo',
10+
'uri' => 'bar',
11+
'ssl_method' => SOAP_SSL_METHOD_TLS,
12+
]);
13+
14+
?>
15+
--EXPECTF--
16+
Deprecated: SoapClient::__construct(): The "ssl_method" option is deprecated. Use "ssl" stream context options instead in %s on line %d

0 commit comments

Comments
 (0)