diff --git a/UPGRADING b/UPGRADING index 6c0976fa3cb..833af3da21b 100644 --- a/UPGRADING +++ b/UPGRADING @@ -406,6 +406,13 @@ PHP 8.1 UPGRADE NOTES . The PDO::FETCH_SERIALIZE mode has been deprecated. RFC: https://wiki.php.net/rfc/phase_out_serializable +- SOAP: + . The ssl_method option for the SoapClient constructor has been deprecated in + favor of ssl stream context options. The direct equivalent would be + crypto_method, but min_proto_version/max_proto_version are recommended + instead. + RFC: https://wiki.php.net/rfc/deprecations_php_8_1 + - Standard: . Calling key(), current(), next(), prev(), reset(), or end() on objects is deprecated. Instead cast the object to array first, or make use of diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 29fba2613af..ef46c5e11bf 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -2127,6 +2127,9 @@ PHP_METHOD(SoapClient, __construct) if ((tmp = zend_hash_str_find(ht, "ssl_method", sizeof("ssl_method")-1)) != NULL && Z_TYPE_P(tmp) == IS_LONG) { add_property_long(this_ptr, "_ssl_method", Z_LVAL_P(tmp)); + php_error_docref(NULL, E_DEPRECATED, + "The \"ssl_method\" option is deprecated. " + "Use \"ssl\" stream context options instead"); } } else if (!wsdl) { php_error_docref(NULL, E_ERROR, "'location' and 'uri' options are required in nonWSDL mode"); diff --git a/ext/soap/tests/ssl_method_deprecation.phpt b/ext/soap/tests/ssl_method_deprecation.phpt new file mode 100644 index 00000000000..2336472ca73 --- /dev/null +++ b/ext/soap/tests/ssl_method_deprecation.phpt @@ -0,0 +1,16 @@ +--TEST-- +ssl_method option is deprecated +--EXTENSIONS-- +soap +--FILE-- + 'foo', + 'uri' => 'bar', + 'ssl_method' => SOAP_SSL_METHOD_TLS, +]); + +?> +--EXPECTF-- +Deprecated: SoapClient::__construct(): The "ssl_method" option is deprecated. Use "ssl" stream context options instead in %s on line %d