Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove insecure SSLv3 fallback, use TLS 1.2 if possible #2131

Merged
merged 1 commit into from Sep 24, 2017

Conversation

kelunik
Copy link
Contributor

@kelunik kelunik commented Sep 20, 2017

STREAM_CRYPTO_METHOD_TLS_CLIENT is only TLS 1.0 except for PHP 5.6.0-5.6.6 and 7.2.0+.

@mention-bot
Copy link

@kelunik, thanks for your PR! By analyzing the history of the files in this pull request, we identified @splitbrain, @whoopdedo and @Klap-in to be potential reviewers.

// @link https://bugs.php.net/69195
$cryptoMethod = PHP_VERSION_ID >= 50600 && PHP_VERSION_ID <= 50606
? STREAM_CRYPTO_METHOD_TLS_CLIENT
: STREAM_CRYPTO_METHOD_SSLv23_CLIENT; // actually means neither SSLv2 nor SSLv3
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to have this in a proper if/then/else structure with parentheses instead of a multi line tertiary operator.

Also according to http://php.net/manual/en/function.stream-socket-enable-crypto.php, the crypto type parameter is optional since 5.6. Would it make sense to omit it completely instead? That way this would be more future proof?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's only optional if it's set in the stream context. PHP's defaults are also borked, I fixed that in PHP 7.2.

I don't really care whether it's a tertiary or an if, I'd definitely agree if there were more conditions.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Can you adjust the syntax? Then I'll push the big green button ;-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

STREAM_CRYPTO_METHOD_TLS_CLIENT is only TLS 1.0 except for PHP 5.6.0-5.6.6 and 7.2.0+.
@splitbrain
Copy link
Collaborator

thanks!

@splitbrain splitbrain merged commit 4616f46 into dokuwiki:master Sep 24, 2017
@kelunik kelunik deleted the http-client-tls branch September 24, 2017 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants