query: allow multiple TLS server names #899
Closed
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.
Signed-off-by: Adrien Fillon adrien.fillon@cdiscount.com
Alright, I managed to spent a bit of time working on this. As I learned in golang/go#22836 the same feature doesn't exist on the client side apparently so we can't just add a hook and be done. I had to wrap the TLS handshake to send the right server name based on the hostname.
I'm happy with this change though I wonder if I should split the transport wrapper to another file ?
Changes
--grpc-client-server-name
flag--grpc-client-server-name-map
multi-flag that can look likethanos-.*=thanos-prometheus.local
to match against any hostname starting withthanos-
to sendthanos-prometheus.local
as server name for TLS handshake.Verification
Added a few tests and deployed it live 😄 I have different certificates for my stores and for my sidecars, both now work.