Validate CN if CURLOPT_SSL_VERIFYHOST is set to true#221
Merged
php-pulls merged 1 commit intophp:masterfrom Oct 25, 2012
Merged
Validate CN if CURLOPT_SSL_VERIFYHOST is set to true#221php-pulls merged 1 commit intophp:masterfrom
php-pulls merged 1 commit intophp:masterfrom
Conversation
Contributor
Author
|
Stas - I saw your comment (not sure where it went now), I've changed it to a notice instead of a warning. |
Contributor
|
Please note that this will cause errors that are not intended. The Additionally, a test for the new functionality will be needed. I've whipped up a new test for it. It should be implemented at |
Contributor
Author
|
Updated in PR - thx. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Per https://crypto.stanford.edu/~dabo/pubs/abstracts/ssl-client-bugs.html - if CURLOPT_SSL_VERIFYHOST is set to "true", convert_to_long_ex sets the LVAL to 1.
libcurl handles the CURLOPT_SSL_VERIFYHOST=1 differently than the default value, 2. CURLOPT_SSL_VERIFYHOST=1 will not check the common name (essentially allowing a MITM attack). A long value of 2 will validate the common name.
http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTSSLVERIFYHOST
I realize this may have impact to code previously setting CURLOPT_SSL_VERIFYHOST to "true" and not worrying about the CN validation - which may now break because libcurl will execute the CN validation. Don't think this is a particularly negative thing - presuming peoples' code had it set to "true" to begin with for peer + host validation.
[amended] - after discussion on internals, setting CURLOPT_SSL_VERIFYHOST should trigger a warning but the lval should remain 1.
[amended] Stas recommends this should be a notice and not a warning, makes sense to me.