Explicitly set supported TLS versions for PHP5.6+#31
Explicitly set supported TLS versions for PHP5.6+#31cboden merged 2 commits intoreactphp-legacy:masterfrom
Conversation
|
Thoughts on using |
|
Yes, absolutely specify the crypto methods as a bitmask here. In particular you should do this because there was a big discussion on the security mailing list on this topic and the result is you'll get inconsistent behavior between Also, I'm going to push for deprecation of all the extraneous encryption wrappers soon (maybe for 7.0 with hopeful removal in 8.0) as they only create confusion. With the ability to specify the protocol flags as a bitmask in 5.6 you always want to do that instead of relying on the stream wrapper to choose your available protocols. This is always the best option because it removes any ambiguity about which protocols the stream will/won't allow. |
|
👍 I agree, this should probably check Also, this should not overwrite the original And while we're at it, I suppose it makes sense to add this as an optional |
|
LGTM
IMO this PR looks good as is, considering it was only meant to be about a sane default behavior. |
|
Alright, I'll look into another PR for that later 👍 |
For
PHP5.6+with the newSSLfixes in that version also changed the way some of the constants work some how forcingSTREAM_CRYPTO_METHOD_TLS_CLIENTtoTLS1.0. The older5.4and5.5versions of that constant seem to includeTLS1.1andTLS1.2.I came across this issue when a remote server I was connecting to supported
SSLv2,SSLv3,TLS1.1, andTLS1.2but notTLS1.0.PHPwas throwing the following error:By explicitly assigning
1.0,1.1, and1.2support toStreamEncryption::methodforPHP5.6+theSSLhandshake succeeds and the connections follows it's expected course.