tlsutil: fix ServerName used for health checks that use TLS#10490
Merged
Conversation
In preparation for adding more test cases.
This was referenced Jun 24, 2021
Don't use the agent node name or agent server name when EnableAgentTLSForChecks=false.
c945075 to
d09027c
Compare
freddygv
approved these changes
Jun 24, 2021
| } | ||
|
|
||
| cmpTLSConfig := cmp.Options{ | ||
| cmpopts.IgnoreFields(tls.Config{}, "GetCertificate", "GetClientCertificate"), |
Contributor
There was a problem hiding this comment.
oh cool, TIL about cmp being able to ignore 👍🏽
Contributor
Author
There was a problem hiding this comment.
Oh ya! This is one of the big reasons I prefer go-cmp over reflect.DeepEqual. Being able to customize the comparison like this makes it much easier to write strict test cases that compare the full return value (instead of picking out parts of the return value and likely missing important fields as they are added).
Collaborator
|
🍒 If backport labels were added before merging, cherry-picking will start automatically. To retroactively trigger a backport after merging, add backport labels and re-run https://circleci.com/gh/hashicorp/consul/396953. |
Collaborator
dnephin
added a commit
that referenced
this pull request
Jun 24, 2021
…heck tlsutil: fix ServerName used for health checks that use TLS
chrisboulton
pushed a commit
to bigcommerce/consul
that referenced
this pull request
Jun 28, 2021
…-health-check tlsutil: fix ServerName used for health checks that use TLS
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.
Fixes #10481
Related to #9475 (comment)
When
EnableAgentTLSForChecksis disabled we should not default to the agent server or node name.The specific fix and test case can be seen in the second commit.