Skip to content

Commit

Permalink
Merge pull request #164 from 56quarters/tls-types
Browse files Browse the repository at this point in the history
Switch to rustls_pki_types crate for TLS types
  • Loading branch information
56quarters authored Jul 19, 2024
2 parents bc7d269 + e8a54c3 commit 88f063a
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions mtop-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ edition = "2021"
[dependencies]
byteorder = "1.5.0"
pin-project-lite = "0.2.13"
rand = "0.8.5"
rustls-pemfile = "2.1.0"
rustls-webpki = { version = "0.102.5", default-features = false }
rustls-pki-types = "1.7.0"
tokio = { version = "1.36.0", features = ["full"] }
tokio-rustls = { version = "0.26.0", default-features = false, features = ["aws_lc_rs", "tls12"] }
tracing = "0.1.40"
urlencoding = "2.1.2"
webpki-roots = "0.26.1"
rand = "0.8.5"

[lib]
name = "mtop_client"
Expand Down
4 changes: 2 additions & 2 deletions mtop-client/src/discovery.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use crate::core::MtopError;
use crate::dns::{DnsClient, Message, Name, Record, RecordClass, RecordData, RecordType};
use rustls_pki_types::ServerName;
use std::cmp::Ordering;
use std::fmt;
use std::net::{IpAddr, SocketAddr};
use webpki::types::ServerName;

const DNS_A_PREFIX: &str = "dns+";
const DNS_SRV_PREFIX: &str = "dnssrv+";
Expand Down Expand Up @@ -253,10 +253,10 @@ mod test {
Flags, Message, MessageId, Name, Question, Record, RecordClass, RecordData, RecordDataA, RecordDataAAAA,
RecordDataSRV, RecordType,
};
use rustls_pki_types::ServerName;
use std::net::{Ipv4Addr, Ipv6Addr, SocketAddr};
use std::str::FromStr;
use tokio::sync::Mutex;
use webpki::types::ServerName;

#[test]
fn test_server_id_from_ipv4_addr() {
Expand Down
2 changes: 1 addition & 1 deletion mtop-client/src/net.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::core::MtopError;
use rustls_pki_types::{CertificateDer, PrivateKeyDer, ServerName};
use std::fmt::{self, Debug};
use std::fs::File;
use std::io::{self, BufReader};
Expand All @@ -10,7 +11,6 @@ use tokio::runtime::Handle;
use tokio_rustls::client::TlsStream;
use tokio_rustls::rustls::{ClientConfig, RootCertStore};
use tokio_rustls::TlsConnector;
use webpki::types::{CertificateDer, PrivateKeyDer, ServerName};

/// Configuration for establishing a TLS connection to server with optional mTLS.
#[derive(Debug, Clone, Default)]
Expand Down
2 changes: 1 addition & 1 deletion mtop/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ crossterm = "0.27.0"
mtop-client = { path = "../mtop-client", version = "0.11.0" }
rand = "0.8.5"
rand_distr = "0.4.3"
rustls-webpki = { version = "0.102.5", default-features = false }
rustls-pki-types = "1.7.0"
ratatui = "0.27.0"
tokio = { version = "1.14.0", features = ["full"] }
tracing = "0.1.11"
Expand Down
2 changes: 1 addition & 1 deletion mtop/src/bin/mc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use mtop_client::{
DiscoveryDefault, MemcachedClient, MemcachedPool, MemcachedPoolConfig, Meta, MtopError, SelectorRendezvous, Server,
Timeout, TlsConfig, Value,
};
use rustls_pki_types::{InvalidDnsNameError, ServerName};
use std::path::PathBuf;
use std::process::ExitCode;
use std::sync::atomic::AtomicBool;
Expand All @@ -15,7 +16,6 @@ use std::{env, io};
use tokio::io::{AsyncReadExt, AsyncWriteExt, BufReader, BufWriter};
use tokio::runtime::Handle;
use tracing::{Instrument, Level};
use webpki::types::{InvalidDnsNameError, ServerName};

const DEFAULT_LOG_LEVEL: Level = Level::INFO;
const DEFAULT_HOST: &str = "localhost:11211";
Expand Down
2 changes: 1 addition & 1 deletion mtop/src/bin/mtop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use mtop_client::{
DiscoveryDefault, MemcachedClient, MemcachedPool, MemcachedPoolConfig, MtopError, SelectorRendezvous, Server,
Timeout, TlsConfig,
};
use rustls_pki_types::{InvalidDnsNameError, ServerName};
use std::env;
use std::path::PathBuf;
use std::process::ExitCode;
Expand All @@ -14,7 +15,6 @@ use tokio::runtime::Handle;
use tokio::task;
use tracing::instrument::WithSubscriber;
use tracing::{Instrument, Level};
use webpki::types::{InvalidDnsNameError, ServerName};

const DEFAULT_LOG_LEVEL: Level = Level::INFO;
const DEFAULT_THEME: Theme = TAILWIND;
Expand Down

0 comments on commit 88f063a

Please sign in to comment.