Skip to content

feat: add custom TLS config support#271

Open
RequiemP wants to merge 1 commit intoqdrant:devfrom
RequiemP:add-custom-tls
Open

feat: add custom TLS config support#271
RequiemP wants to merge 1 commit intoqdrant:devfrom
RequiemP:add-custom-tls

Conversation

@RequiemP
Copy link

All Submissions:

  • Contributions should target the dev branch. Did you create your branch from dev?
  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  1. Does your submission pass tests?
  2. Have you formatted your code locally using cargo +nightly fmt --all command prior to submission?
  3. Have you checked your code using cargo clippy --all --all-features command?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Description

This PR adds support for custom TLS configuration in Qdrant client. This enhancement allows users to provide their own ClientTlsConfig, offering greater flexibility for connecting to Qdrant in various environments

Changes:

  1. Added a tls_config: Option<ClientTlsConfig> field to the QdrantConfig struct.
  2. Added a tls_config: Option<ClientTlsConfig> field to the ChannelPool struct.
  3. Introduced tls_config and set_tls_config methods to QdrantConfig for configuring TLS.
  4. Updated make_channel method within ChannelPool to use the custom tls_config if provided, falling back to the default ClientTlsConfig::new().with_native_roots() otherwise.

Example Usage

let ca_cert_pem = std::fs::read_to_string("path/to/ca.crt")?;
let tls_config = ClientTlsConfig::new()
    .ca_certificate(Certificate::from_pem(ca_cert_pem));

let client = Qdrant::from_url("http://localhost:6334")
    .tls_config(Some(custom_tls_config))
    .build()?;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant