Repository navigation
Add tls_domain_name and origin options to QdrantConfig - #309
Open
inamdarmihir wants to merge 1 commit into
Open
inamdarmihir wants to merge 1 commit into
inamdarmihir wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
All Submissions:
devbranch. Did you create your branch fromdev?tls_config; this PR only adds the two options below and doesn't depend on it.New Feature Submissions:
cargo test --lib: 40 passed. Integration tests that need a live Qdrant were not run.)cargo +nightly fmt --allcommand prior to submission? (cargo fmt --checkis clean on the stable toolchain; the nightly-only import options aren't applied.)cargo clippy --all --all-featurescommand? (cargo clippy --all-targets --all-features -- -D warningsis clean.)Changes to Core Features:
What
Adds two optional fields to
QdrantConfig, bothNoneby default, with builder methods:tls_domain_nameis passed toClientTlsConfig::domain_nameforhttpsURIs.originis passed toEndpoint::origin.ChannelPool::make_channelnow builds its endpoint in a small privatebuild_endpointhelper, so the TLS and origin settings can be unit-tested without connecting.Why
When the client dials a tunnel or proxy whose address differs from the server name (for example an SSH forward at
https://127.0.0.1:50123in front ofqdrant.internal:6334), the certificate is checked against127.0.0.1, and requests carry127.0.0.1:50123as the:authority. There was no way to change either, since the channel is built internally. Fixes #306.How was it tested
cargo test --lib: 40 passed, including new tests for the config defaults, the builder methods, and the endpoint construction with and without the two options (including an invalid origin returning an error).127.0.0.1: withtls_domain_nameset, the handshake uses that name, and verification is still enforced (an untrusted certificate fails withUnknownIssuer).Verification isn't weakened. Only the name it is checked against changes, and nothing changes when the options are unset.
Fixes #306
Authored by Mihir Inamdar.