Skip to content

Commit ed4a76f

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 d59fc0a commit ed4a76f

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

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)