Skip to content

Commit

Permalink
add: tokio_tls dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
FranciscaOrtegaG committed Aug 14, 2024
1 parent 1da81bb commit 3a681b5
Show file tree
Hide file tree
Showing 4 changed files with 202 additions and 9 deletions.
196 changes: 189 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ sha2 = "0.10.2"
hmac = "0.12.1"
rust-crypto = "0.2"
base64 = "0.22.1"

tokio-tls = "0.3.1"
lru = "0.12.3"
rustls = "0.23.12"

Expand Down
4 changes: 4 additions & 0 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ use crate::client::client_connection::ClientConnection;
use crate::message::DnsMessage;
use crate::domain_name::DomainName;


use rustls::Connection;
use rustls::ClientConfig;
use rand::{thread_rng, Rng};

use self::client_error::ClientError;
Expand Down Expand Up @@ -42,6 +45,7 @@ impl <T: ClientConnection> Client<T> {
/// ```
pub fn new(conn: T) -> Self {


let client = Client {
conn: conn,
dns_query: DnsMessage::new(),
Expand Down
9 changes: 8 additions & 1 deletion src/client/client_connection.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
use crate::message::DnsMessage;
use std::net::IpAddr;
use tokio::time::Duration;
use async_trait::async_trait;
use super::client_error::ClientError;

use tokio::net::TcpStream;
use tokio_rustls::rustls::{ClientConfig, ServerName};
use tokio_rustls::TlsConnector;
use std::sync::Arc;
use webpki::DNSNameRef;
use async_trait::async_trait;


#[async_trait]
pub trait ClientConnection: Copy {//: 'static + Sized + Send + Sync + Unpin

Expand Down

0 comments on commit 3a681b5

Please sign in to comment.