Conversation
If certificate check fails, SSL_Connect will fail, thus the removed code will not run. It would only runs when successful. That function is meant to check the error code when there is a certificate validation issue. SSL_get_verify_result is being used incorrectly here; it is intended to get the validation error reason when SSL_Connect fails, and that failure is due to an invalid certificate.
archigup
force-pushed
the
hostnameChecking
branch
from
October 6, 2022 23:20
59d62f0 to
dff1232
Compare
This reverts commit cd1b87b.
paulbartell
reviewed
Oct 31, 2022
| sslStatus = SSL_set1_host( pOpensslParams->pSsl, pServerInfo->pHostName ); | ||
|
|
||
| if( sslStatus != 1 ) | ||
| if( pOpensslCredentials->disableHostnameCheck == 0U ) |
Contributor
There was a problem hiding this comment.
I would prefer that we add a separate connect() function which takes a sockaddr_in rather than a hostname.
This would encourage the use of SNI whenever possible.
Contributor
There was a problem hiding this comment.
But I think just checking for pOpensslCredentials->sniHostName != NULL should be sufficient here.
paulbartell
reviewed
Oct 31, 2022
| */ | ||
| const char * sniHostName; | ||
|
|
||
| /** |
Contributor
There was a problem hiding this comment.
sniHostName == NULL should result in SNI being disabled rather than an explicit disableHostnameCheck.
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.
This will allow demos to disable hostname checking, allowing them to be used with Greengrass or other endpoints that do not have the hostname in their certificate subject.
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.