[GH-ISSUE #1581] Problem with Dns Over Https with rustls #701

Open
opened 2026-03-15 23:54:16 +03:00 by kerem · 1 comment
Owner

Originally created by @es1o on GitHub (Nov 1, 2021).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1581

Describe the bug
I can't use trust-dns-client with rustls 0.20.0

To Reproduce

  1. use trust-dns-client `0.20.3
  2. use rustls 0.20.0
  3. Create rustls::ClientConfig:
  let config = rustls::ClientConfig::builder()
    .with_safe_defaults()
    .with_root_certificates(root_store)
    .with_no_client_auth();
  1. Try to create HttpsClientConnection:
  let x = HttpsClientConnection {
    name_server: doh_socket,
    dns_name: "dns_server.pl".to_string(),
    client_config: config,
    marker: PhantomData,
  };
  1. Compile and get error:
error[E0308]: mismatched types
  --> src/main.rs:70:20
   |
70 |     client_config: config,
   |                    ^^^^^^ expected struct `rustls::client::ClientConfig`, found struct `ClientConfig`

For more information about this error, try `rustc --explain E0308`.
error: could not compile `malw` due to previous error

Expected behavior
Compilation success

System:

  • OS: [macOS]
  • Architecture: [x86_64]
  • Version [12.0.1]
  • rustc version: [1.56.0]

Version:
Crate: client
Version: [0.20.3]

Originally created by @es1o on GitHub (Nov 1, 2021). Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1581 **Describe the bug** I can't use trust-dns-client with rustls `0.20.0` **To Reproduce** 1. use trust-dns-client `0.20.3 2. use rustls `0.20.0` 3. Create rustls::ClientConfig: ``` let config = rustls::ClientConfig::builder() .with_safe_defaults() .with_root_certificates(root_store) .with_no_client_auth(); ``` 4. Try to create HttpsClientConnection: ``` let x = HttpsClientConnection { name_server: doh_socket, dns_name: "dns_server.pl".to_string(), client_config: config, marker: PhantomData, }; ``` 5. Compile and get error: ``` error[E0308]: mismatched types --> src/main.rs:70:20 | 70 | client_config: config, | ^^^^^^ expected struct `rustls::client::ClientConfig`, found struct `ClientConfig` For more information about this error, try `rustc --explain E0308`. error: could not compile `malw` due to previous error ``` **Expected behavior** Compilation success **System:** - OS: [macOS] - Architecture: [x86_64] - Version [12.0.1] - rustc version: [1.56.0] **Version:** Crate: client Version: [0.20.3]
Author
Owner

@djc commented on GitHub (Nov 1, 2021):

This is expected. You can use released trust-dns with rustls 0.19 for now or trust-dns from the main branch if you need rustls 0.20.

<!-- gh-comment-id:956634477 --> @djc commented on GitHub (Nov 1, 2021): This is expected. You can use released trust-dns with rustls 0.19 for now or trust-dns from the main branch if you need rustls 0.20.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hickory-dns#701
No description provided.