php/php-src — pull request #335 by Iversion (2013-04-26 20:54:00+00:00)
Title: Added SoapClient constructor option 'ssl_method' to specify ssl method

SSL behavior was defaulting to SSLv23 which will always send the Client Hello
message in SSLv2. This sometimes results in a connection rejection when the
SOAP server rejects any traffic using SSLv2. This occurs on many IIS web
servers as well as Oracle/Sun web servers as well. SSLv2 has been deemed
highly insecure and has been deprecated for some time.

The new optional SoapClient constructor option: ssl_method, takes an argument
from the list of constants defined below:

SOAP_SSL_METHOD_TLS
SOAP_SSL_METHOD_SSLv2
SOAP_SSL_METHOD_SSLv3
SOAP_SSL_METHOD_SSLv23

If the ssl_method option is not specified it will default to the behavior
prior to this patch of using SSLv23. Specifying the SSL method will use the
proper URI protocol of 'sslv2', 'sslv3', 'tls' or the default sslv23 URI
protocol, 'ssl' when the PHP stream is created.

If a proxy is specified in the SoapClient constructor and
the connection is set to use SSL an unencrypted stream will first be created
and encryption applied to the stream using the stream_socket_enable_crypto
client methods. If no SSL method is specified in the SoapClient constructor
the encryption method that is applied to an SSL connection through a proxy
will be STREAM_CRYPTO_METHOD_SSLv23_CLIENT which is the current default
behavior.

The ability to specify an SSL method is important to implement as other PHP
functions such as cURL have the ability to specify the SSL version to use.