Add support for rustls with aws-lc-rs

This commit is contained in:
Dirkjan Ochtman 2024-10-25 10:06:12 +02:00
parent 1bc8c9a5ec
commit 492ac1c808
2 changed files with 9 additions and 7 deletions

View File

@ -8,8 +8,10 @@ description = "EPP client library for async Rust"
repository = "https://github.com/instant-labs/instant-epp"
[features]
default = ["rustls"]
rustls = ["tokio-rustls", "rustls-native-certs"]
default = ["rustls-aws-lc-rs"]
rustls-aws-lc-rs = ["dep:tokio-rustls", "tokio-rustls/aws-lc-rs", "dep:rustls-native-certs"]
rustls-ring = ["dep:tokio-rustls", "tokio-rustls/ring", "dep:rustls-native-certs"]
__rustls = []
[dependencies]
async-trait = "0.1.52"
@ -19,7 +21,7 @@ instant-xml = { version = "0.5", features = ["chrono"] }
rustls-native-certs = { version = "0.8", optional = true }
serde = { version = "1.0", features = ["derive"] }
tokio = { version = "1.0", features = ["io-util", "net", "time"] }
tokio-rustls = { version = "0.26", optional = true, default-features = false, features = ["logging", "ring", "tls12"] }
tokio-rustls = { version = "0.26", optional = true, default-features = false, features = ["logging", "tls12"] }
tracing = "0.1.29"
[dev-dependencies]

View File

@ -1,6 +1,6 @@
use std::time::Duration;
#[cfg(feature = "rustls")]
#[cfg(feature = "__rustls")]
use tokio_rustls::rustls::pki_types::{CertificateDer, PrivateKeyDer};
use tracing::{debug, error};
@ -68,7 +68,7 @@ pub struct EppClient<C: Connector> {
connection: EppConnection<C>,
}
#[cfg(feature = "rustls")]
#[cfg(feature = "__rustls")]
impl EppClient<RustlsConnector> {
/// Connect to the specified `addr` and `hostname` over TLS
///
@ -205,10 +205,10 @@ impl<C, E> Clone for RequestData<'_, '_, C, E> {
// Manual impl because this does not depend on whether `C` and `E` are `Copy`
impl<C, E> Copy for RequestData<'_, '_, C, E> {}
#[cfg(feature = "rustls")]
#[cfg(feature = "__rustls")]
pub use rustls_connector::RustlsConnector;
#[cfg(feature = "rustls")]
#[cfg(feature = "__rustls")]
mod rustls_connector {
use std::io;
use std::sync::Arc;