diff --git a/src/certificates/acme.rs b/src/certificates/acme.rs index f700465dd..7896be073 100644 --- a/src/certificates/acme.rs +++ b/src/certificates/acme.rs @@ -216,6 +216,135 @@ impl HttpClient { } } +async fn connect_stream( + url: &url::Url, + tls: &Arc, +) -> io::Result> { + let host = url + .host_str() + .ok_or_else(|| invalid("ACME URL has no host"))? + .trim_matches(['[', ']']); + let location = crate::address::NetLocation::new( + crate::address::Address::from(host)?, + url.port_or_known_default().unwrap(), + ); + let addresses = crate::resolver::Resolver::resolve_location( + &crate::resolver::NativeResolver::new(), + &location, + ) + .await?; + let mut stream = None; + for address in addresses.into_iter().take(8) { + let socket = crate::socket_util::new_tcp_socket(None, address.is_ipv6())?; + if let Ok(Ok(connected)) = + tokio::time::timeout(Duration::from_secs(5), socket.connect(address)).await + { + stream = Some(connected); + break; + } + } + let stream = stream.ok_or_else(|| io::Error::other("ACME connection failed"))?; + if url.scheme() == "https" { + let name = rustls::pki_types::ServerName::try_from(host.to_owned()) + .map_err(|_| invalid("invalid ACME TLS hostname"))?; + let connection = rustls::ClientConnection::new(tls.clone(), name) + .map_err(io::Error::other)?; + Ok(Box::new( + crate::crypto::CryptoTlsStream::handshake( + stream, + crate::crypto::TlsConnection::new(connection), + crate::crypto::TlsReadMode::Stream, + &[], + ) + .await?, + )) + } else { + Ok(Box::new(stream)) + } +} + +#[derive(Serialize)] +struct AcmeDnsPayload<'a> { + subdomain: &'a str, + txt: &'a str, +} + +pub(super) async fn update_acme_dns( + tls: Arc, + server_url: &str, + username: &str, + password: &str, + subdomain: &str, + txt: &str, +) -> io::Result<()> { + let mut url = validate_url(server_url)?; + if url.query().is_some() { + return Err(invalid("ACME-DNS server_url must not contain a query string")); + } + url.path_segments_mut() + .map_err(|()| invalid("invalid ACME-DNS server_url"))? + .pop_if_empty(); + if url.path_segments().and_then(|mut s| s.next_back()) != Some("update") { + url.path_segments_mut() + .map_err(|()| invalid("invalid ACME-DNS server_url"))? + .push("update"); + } + let authority = url[url::Position::BeforeHost..url::Position::AfterPort].to_owned(); + let path_and_query = url.path().to_owned(); + + let payload = serde_json::to_vec(&AcmeDnsPayload { subdomain, txt }) + .map_err(|e| io::Error::other(format!("failed to serialize ACME-DNS payload: {e}")))?; + + let request = http::Request::builder() + .method("POST") + .uri(path_and_query) + .header(http::header::HOST, authority) + .header("X-Api-User", username) + .header("X-Api-Key", password) + .header(http::header::CONTENT_TYPE, "application/json") + .header(http::header::CONNECTION, "close") + .body(Full::new(Bytes::from(payload))) + .map_err(|e| io::Error::other(format!("failed to build ACME-DNS request: {e}")))?; + + tokio::time::timeout(REQUEST_TIMEOUT, async { + let stream = connect_stream(&url, &tls).await?; + let (mut sender, connection) = hyper::client::conn::http1::Builder::new() + .max_buf_size(32 * 1024) + .handshake(hyper_util::rt::TokioIo::new(stream)) + .await + .map_err(io::Error::other)?; + let response = async { + let response = sender + .send_request(request) + .await + .map_err(io::Error::other)?; + let (parts, body) = response.into_parts(); + Limited::new(body, MAX_RESPONSE) + .collect() + .await + .map_err(|_| io::Error::other("ACME-DNS response failed or exceeded limit"))?; + // Never log the remote body; the status is enough to diagnose. + if !parts.status.is_success() { + return Err(io::Error::other(format!( + "ACME-DNS update returned HTTP {}", + parts.status + ))); + } + Ok::<_, io::Error>(()) + }; + tokio::pin!(response, connection); + tokio::select! { + result = &mut response => result, + result = &mut connection => { + result.map_err(io::Error::other)?; + response.await + } + } + }) + .await + .map_err(|_| io::Error::new(io::ErrorKind::TimedOut, "ACME-DNS request timed out"))? +} + impl instant_acme::HttpClient for HttpClient { fn request( &self, @@ -238,47 +367,7 @@ impl instant_acme::HttpClient for HttpClient { "ACME HTTPS directory cannot downgrade to HTTP endpoints", )); } - let host = url - .host_str() - .ok_or_else(|| invalid("ACME URL has no host"))? - .trim_matches(['[', ']']); - let location = crate::address::NetLocation::new( - crate::address::Address::from(host)?, - url.port_or_known_default().unwrap(), - ); - let addresses = crate::resolver::Resolver::resolve_location( - &crate::resolver::NativeResolver::new(), - &location, - ) - .await?; - let mut stream = None; - for address in addresses.into_iter().take(8) { - let socket = crate::socket_util::new_tcp_socket(None, address.is_ipv6())?; - if let Ok(Ok(connected)) = - tokio::time::timeout(Duration::from_secs(5), socket.connect(address)).await - { - stream = Some(connected); - break; - } - } - let stream = stream.ok_or_else(|| io::Error::other("ACME connection failed"))?; - let stream: Box = if url.scheme() == "https" { - let name = rustls::pki_types::ServerName::try_from(host.to_owned()) - .map_err(|_| invalid("invalid ACME TLS hostname"))?; - let connection = rustls::ClientConnection::new(client.tls.clone(), name) - .map_err(io::Error::other)?; - Box::new( - crate::crypto::CryptoTlsStream::handshake( - stream, - crate::crypto::TlsConnection::new(connection), - crate::crypto::TlsReadMode::Stream, - &[], - ) - .await?, - ) - } else { - Box::new(stream) - }; + let stream = connect_stream(&url, &client.tls).await?; let authority = request .uri() .authority() @@ -1070,6 +1159,7 @@ impl Scheduler { deadline: tokio::time::Instant, ) -> Result<(), Failure> { let client = self.client(config)?; + let mut dns_published = false; let mut authorizations = order.authorizations(); loop { let (authorization, response) = client @@ -1098,9 +1188,10 @@ impl Scheduler { }); } Self::defer_hint(config, state, response)?; - let kind = match config.challenge { + let kind = match &config.challenge { ChallengeConfig::Http01 { .. } => ChallengeType::Http01, ChallengeConfig::TlsAlpn01 => ChallengeType::TlsAlpn01, + ChallengeConfig::AcmeDns { .. } => ChallengeType::Dns01, }; let mut challenge = authorization @@ -1138,6 +1229,30 @@ impl Scheduler { return Err(instant_acme::Error::Str("CA returned invalid challenge token").into()); } let authorization = challenge.key_authorization(); + if let ChallengeConfig::AcmeDns { + server_url, + username, + password, + subdomain, + .. + } = &config.challenge + { + // Publish every TXT value now; challenges are marked ready after one shared wait below. + if challenge.status == ChallengeStatus::Pending { + update_acme_dns( + client_tls(None).map_err(|error| instant_acme::Error::Other(Box::new(error)))?, + server_url, + username, + &password.0, + subdomain, + &authorization.dns_value(), + ) + .await + .map_err(|error| instant_acme::Error::Other(Box::new(error)))?; + dns_published = true; + } + continue; + } let tls = if kind == ChallengeType::TlsAlpn01 { Some( challenge::tls_config(&domain, authorization.digest().as_ref()) @@ -1162,6 +1277,35 @@ impl Scheduler { Self::defer_hint(config, state, response)?; } } + if dns_published { + if let ChallengeConfig::AcmeDns { + propagation_delay: Some(delay), + .. + } = &config.challenge + { + let wake = tokio::time::Instant::now() + Duration::from_secs(*delay); + tokio::time::sleep_until(wake.min(deadline)).await; + } + let mut authorizations = order.authorizations(); + loop { + let (authorization, response) = client + .perform(deadline, async { authorizations.next().await.transpose() }) + .await?; + let Some(mut authorization) = authorization else { + break; + }; + if authorization.status != AuthorizationStatus::Pending { + continue; + } + Self::defer_hint(config, state, response)?; + if let Some(mut challenge) = authorization.challenge(ChallengeType::Dns01) + && challenge.status == ChallengeStatus::Pending + { + let ((), response) = client.perform(deadline, challenge.set_ready()).await?; + Self::defer_hint(config, state, response)?; + } + } + } Ok(()) } } diff --git a/src/certificates/acme_tests.rs b/src/certificates/acme_tests.rs index a6af37d56..c6d63aff3 100644 --- a/src/certificates/acme_tests.rs +++ b/src/certificates/acme_tests.rs @@ -198,6 +198,7 @@ struct CaState { nonce_failure: bool, bad_nonces: usize, fail_state_sync_on: Option<&'static str>, + dns_records: Option>>>, } struct Fixture { @@ -267,6 +268,7 @@ impl Fixture { nonce_failure: false, bad_nonces: 0, fail_state_sync_on: None, + dns_records: None, })); let fail = Arc::new(AtomicBool::new(false)); let requests = Arc::new(AtomicUsize::new(0)); @@ -643,7 +645,7 @@ async fn handle( } async fn validate_challenge(state: &Arc>, id: usize) -> io::Result<()> { - let (address, kind, token, authorization) = { + let (address, kind, token, authorization, dns_records) = { let state = state.lock(); let token = state.orders[id].token.clone(); ( @@ -651,6 +653,7 @@ async fn validate_challenge(state: &Arc>, id: usize) -> io::Resul state.kind, token.clone(), format!("{token}.{}", thumbprint(state.jwk.as_ref().unwrap())), + state.dns_records.clone(), ) }; if kind == "http-01" { @@ -668,6 +671,17 @@ async fn validate_challenge(state: &Arc>, id: usize) -> io::Resul let bytes = String::from_utf8(bytes).unwrap(); assert!(bytes.starts_with("HTTP/1.1 200 ")); assert_eq!(bytes.split_once("\r\n\r\n").unwrap().1, authorization); + } else if kind == "dns-01" { + let records = dns_records.expect("dns_records required for dns-01"); + let expected_digest = B64.encode(aws_lc_rs::digest::digest( + &aws_lc_rs::digest::SHA256, + authorization.as_bytes(), + )); + let found = records.lock().values().any(|val| val == &expected_digest); + assert!( + found, + "expected dns-01 TXT record with digest {expected_digest} was not found in acme-dns records" + ); } else { validate_tls_challenge(address, &authorization).await; } @@ -2333,3 +2347,243 @@ fn acme_diagnostics_omit_remote_details_and_json_values() { let error = serde_json::from_str::(&format!("\"{secret}\"")).unwrap_err(); assert!(!failure_message(&instant_acme::Error::Json(error)).contains(secret)); } + +struct MockAcmeDns { + address: SocketAddr, + records: Arc>>, + auth: Arc>>, + status_code: Arc, + task: tokio::task::JoinHandle<()>, +} + +impl MockAcmeDns { + async fn start() -> Self { + let listener = TcpListener::bind("127.0.0.1:0").await.unwrap(); + let address = listener.local_addr().unwrap(); + let records = Arc::new(Mutex::new(std::collections::HashMap::::new())); + let auth = Arc::new(Mutex::new(None)); + let status_code = Arc::new(std::sync::atomic::AtomicU16::new(200)); + + let server_records = records.clone(); + let server_auth = auth.clone(); + let server_status = status_code.clone(); + + let task = tokio::spawn(async move { + let mut connections = JoinSet::new(); + loop { + tokio::select! { + accepted = listener.accept() => { + let Ok((stream, _)) = accepted else { break; }; + let records = server_records.clone(); + let auth = server_auth.clone(); + let status_code = server_status.clone(); + connections.spawn(async move { + let service = hyper::service::service_fn(move |request: http::Request| { + let records = records.clone(); + let auth = auth.clone(); + let status_code = status_code.clone(); + async move { + let status = status_code.load(Ordering::SeqCst); + if status != 200 { + let response = http::Response::builder() + .status(status) + .body(Full::new(Bytes::from(format!("error status {status}")))) + .unwrap(); + return Ok::<_, io::Error>(response); + } + if request.method() != http::Method::POST || request.uri().path() != "/update" { + let response = http::Response::builder() + .status(404) + .body(Full::new(Bytes::from("not found"))) + .unwrap(); + return Ok(response); + } + let user = request.headers().get("x-api-user").and_then(|v| v.to_str().ok()).unwrap_or_default(); + let pass = request.headers().get("x-api-key").and_then(|v| v.to_str().ok()).unwrap_or_default(); + if let Some((expected_user, expected_pass)) = auth.lock().as_ref() + && (user != expected_user || pass != expected_pass) + { + let response = http::Response::builder() + .status(401) + .body(Full::new(Bytes::from("unauthorized"))) + .unwrap(); + return Ok(response); + } + let body_bytes = request.into_body().collect().await.map_err(io::Error::other)?.to_bytes(); + let parsed: Value = serde_json::from_slice(&body_bytes).map_err(io::Error::other)?; + let Some(subdomain) = parsed["subdomain"].as_str() else { + let response = http::Response::builder() + .status(400) + .body(Full::new(Bytes::from("missing subdomain"))) + .unwrap(); + return Ok(response); + }; + let Some(txt) = parsed["txt"].as_str() else { + let response = http::Response::builder() + .status(400) + .body(Full::new(Bytes::from("missing txt"))) + .unwrap(); + return Ok(response); + }; + records.lock().insert(subdomain.to_string(), txt.to_string()); + let response = http::Response::builder() + .status(200) + .header("content-type", "application/json") + .body(Full::new(Bytes::from(format!(r#"{{"txt":"{txt}"}}"#)))) + .unwrap(); + Ok(response) + } + }); + let _ = hyper::server::conn::http1::Builder::new() + .serve_connection(hyper_util::rt::TokioIo::new(stream), service) + .await; + }); + } + _ = connections.join_next(), if !connections.is_empty() => {} + } + } + }); + + Self { + address, + records, + auth, + status_code, + task, + } + } + + fn url(&self) -> String { + format!("http://{}", self.address) + } +} + +impl Drop for MockAcmeDns { + fn drop(&mut self) { + self.task.abort(); + } +} + +#[tokio::test] +async fn acme_dns_client_update_and_error_handling() { + let mock = MockAcmeDns::start().await; + *mock.auth.lock() = Some(("test-user".into(), "test-pass".into())); + let tls = client_tls(None).unwrap(); + + // 1. Success + update_acme_dns( + tls.clone(), + &mock.url(), + "test-user", + "test-pass", + "sub-uuid-1", + "txt-digest-abc", + ) + .await + .unwrap(); + assert_eq!( + mock.records.lock().get("sub-uuid-1").map(|s| s.as_str()), + Some("txt-digest-abc") + ); + + // 2. Auth failure + let err = update_acme_dns( + tls.clone(), + &mock.url(), + "wrong-user", + "test-pass", + "sub-uuid-1", + "txt-digest-abc", + ) + .await + .unwrap_err(); + assert!(err.to_string().contains("HTTP 401"), "{err}"); + + // 3. Server 500 error + mock.status_code.store(500, Ordering::SeqCst); + let err = update_acme_dns( + tls.clone(), + &mock.url(), + "test-user", + "test-pass", + "sub-uuid-1", + "txt-digest-abc", + ) + .await + .unwrap_err(); + assert!(err.to_string().contains("HTTP 500"), "{err}"); + assert!(!err.to_string().contains("error status"), "remote body leaked: {err}"); + + // 4. URL path variants: server_url with trailing slash or with /update + mock.status_code.store(200, Ordering::SeqCst); + update_acme_dns( + tls.clone(), + &format!("{}/", mock.url()), + "test-user", + "test-pass", + "sub-uuid-2", + "txt-digest-2", + ) + .await + .unwrap(); + assert_eq!( + mock.records.lock().get("sub-uuid-2").map(|s| s.as_str()), + Some("txt-digest-2") + ); + + update_acme_dns( + tls.clone(), + &format!("{}/update/", mock.url()), + "test-user", + "test-pass", + "sub-uuid-3", + "txt-digest-3", + ) + .await + .unwrap(); + assert_eq!( + mock.records.lock().get("sub-uuid-3").map(|s| s.as_str()), + Some("txt-digest-3") + ); +} + +#[tokio::test] +async fn acme_dns_issuance_roundtrip() { + let directory = tempfile::tempdir().unwrap(); + let mock_dns = MockAcmeDns::start().await; + *mock_dns.auth.lock() = Some(("dns_user".into(), "dns_secret".into())); + + let listener = TcpListener::bind("127.0.0.1:0").await.unwrap(); + let fixture = Fixture::new(listener.local_addr().unwrap(), false).await; + fixture.state.lock().kind = "dns-01"; + fixture.state.lock().dns_records = Some(mock_dns.records.clone()); + + let mut config = fixture.config(directory.path(), false); + config.challenge = ChallengeConfig::AcmeDns { + server_url: mock_dns.url(), + username: "dns_user".into(), + password: crate::config::quic_client::Secret("dns_secret".into()), + subdomain: "subdomain-acme-dns-test".into(), + propagation_delay: Some(0), + }; + let _lock = lock_state(&config).unwrap(); + + let source = Source::new("fixture".into(), super::super::Spec::Acme(config.clone())).unwrap(); + assert!(source.current().is_none()); + + let client = HttpClient::new(client_tls(config.ca_cert.as_deref()).unwrap(), &config); + drive(&source, &config, client.clone()).await.unwrap(); + + let cert = source.current().unwrap().cert[0].clone(); + assert!(!cert.is_empty()); + assert_eq!(fixture.state.lock().accounts, 1); + assert_eq!(fixture.state.lock().orders.len(), 1); + + // Verify mock_dns received the txt record for the subdomain + assert!(mock_dns.records.lock().contains_key("subdomain-acme-dns-test")); + + // Verify resumption / loading cached cert + let resumed = Source::new("fixture".into(), super::super::Spec::Acme(config.clone())).unwrap(); + load_cached(&resumed, &config).unwrap(); + assert_eq!(resumed.current().unwrap().cert[0], cert); +} diff --git a/src/certificates/mod.rs b/src/certificates/mod.rs index edc96daa4..ac94f3afd 100644 --- a/src/certificates/mod.rs +++ b/src/certificates/mod.rs @@ -32,6 +32,8 @@ pub struct NamedSource { #[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)] #[serde(tag = "type", rename_all = "snake_case", deny_unknown_fields)] +// Parsed once at startup; the size gap between variants does not matter. +#[allow(clippy::large_enum_variant)] pub enum SourceConfig { Files { cert: PathBuf, key: PathBuf }, Acme(AcmeConfig), @@ -82,8 +84,19 @@ pub struct AcmeConfig { #[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)] #[serde(tag = "type", rename_all = "snake_case", deny_unknown_fields)] pub enum ChallengeConfig { - Http01 { listen: Vec }, + Http01 { + listen: Vec, + }, TlsAlpn01, + #[serde(rename = "acme_dns", alias = "acmedns")] + AcmeDns { + server_url: String, + username: String, + password: crate::config::quic_client::Secret, + subdomain: String, + #[serde(default)] + propagation_delay: Option, + }, } #[derive(Clone, PartialEq, Eq)] @@ -473,6 +486,40 @@ fn validate_acme(config: &AcmeConfig) -> io::Result<()> { "HTTP-01 requires explicit listen addresses with nonzero ports", )); } + if let ChallengeConfig::AcmeDns { + server_url, + username, + password, + subdomain, + propagation_delay, + } = &config.challenge + { + let url = acme::validate_url(server_url)?; + if url.query().is_some() { + return Err(invalid("ACME-DNS server_url must not contain a query string")); + } + if username.trim().is_empty() || http::HeaderValue::from_str(username).is_err() { + return Err(invalid("ACME-DNS username must be a non-empty HTTP header value")); + } + if password.0.trim().is_empty() || http::HeaderValue::from_str(&password.0).is_err() { + return Err(invalid("ACME-DNS password must be a non-empty HTTP header value")); + } + if subdomain.is_empty() + || !subdomain.bytes().all(|b| b.is_ascii_alphanumeric() || b == b'-') + { + return Err(invalid("ACME-DNS subdomain must contain only letters, digits and '-'")); + } + // acme-dns keeps only the 2 newest TXT values per subdomain, and all are published before validation. + if config.domains.len() > 2 { + return Err(invalid( + "ACME-DNS supports at most 2 domains per certificate source; split larger sets across sources", + )); + } + // One wait per order; keep it well inside the 600 s order deadline. + if propagation_delay.is_some_and(|delay| delay > 300) { + return Err(invalid("ACME-DNS propagation_delay cannot exceed 300 seconds")); + } + } if let Some(path) = &config.ca_cert { acme::client_tls(Some(path))?; } diff --git a/src/certificates/tests.rs b/src/certificates/tests.rs index 1d1f38517..c9d6a7023 100644 --- a/src/certificates/tests.rs +++ b/src/certificates/tests.rs @@ -111,6 +111,8 @@ fn managed_validation_has_no_state_or_network_side_effects() { for challenge in [ "type: http01, listen: ['127.0.0.1:18080']", "type: tls_alpn01", + "type: acme_dns, server_url: 'https://auth.example.com', username: 'user1', password: 'secret', subdomain: 'uuid-subdomain'", + "type: acmedns, server_url: 'https://auth.example.com', username: 'user1', password: 'secret', subdomain: 'uuid-subdomain', propagation_delay: 10", ] { let yaml = managed_yaml(&state, challenge, "certificate_source: public"); let validated = compile(&yaml).unwrap(); @@ -120,6 +122,40 @@ fn managed_validation_has_no_state_or_network_side_effects() { } } +#[test] +fn acme_dns_rejects_more_than_two_domains_and_redacts_password() { + let dir = tempfile::tempdir().unwrap(); + let challenge = "type: acme_dns, server_url: 'https://auth.example.com', username: 'user1', password: 'hunter2-secret', subdomain: 'uuid-subdomain'"; + let yaml = managed_yaml(&dir.path().join("state"), challenge, "certificate_source: public"); + let three = yaml.replace("domains: [proxy.test]", "domains: [proxy.test, a.proxy.test, b.proxy.test]"); + assert!(compile(&three).err().unwrap().to_string().contains("at most 2 domains")); + let config: ChallengeConfig = serde_yaml::from_str(&format!("{{ {challenge} }}")).unwrap(); + assert!(!format!("{config:?}").contains("hunter2-secret")); +} + +#[test] +fn managed_validation_rejects_invalid_acme_dns_configs() { + let dir = tempfile::tempdir().unwrap(); + let state = dir.path().join("not-created"); + for bad_challenge in [ + "type: acme_dns, server_url: 'https://auth.example.com', username: '', password: 'secret', subdomain: 'uuid-subdomain'", + "type: acme_dns, server_url: 'https://auth.example.com', username: ' ', password: 'secret', subdomain: 'uuid-subdomain'", + "type: acme_dns, server_url: 'https://auth.example.com', username: \"user\\nname\", password: 'secret', subdomain: 'uuid-subdomain'", + "type: acme_dns, server_url: 'https://auth.example.com', username: 'user1', password: '', subdomain: 'uuid-subdomain'", + "type: acme_dns, server_url: 'https://auth.example.com', username: 'user1', password: 'secret', subdomain: ''", + "type: acme_dns, server_url: 'https://auth.example.com', username: 'user1', password: 'secret', subdomain: ' '", + "type: acme_dns, server_url: 'ftp://auth.example.com', username: 'user1', password: 'secret', subdomain: 'uuid-subdomain'", + "type: acme_dns, server_url: 'https://auth.example.com#fragment', username: 'user1', password: 'secret', subdomain: 'uuid-subdomain'", + "type: acme_dns, server_url: 'https://auth.example.com', username: 'user1', password: 'secret', subdomain: 'uuid-subdomain', propagation_delay: 301", + "type: acme_dns, server_url: 'https://auth.example.com/acme?x=1', username: 'user1', password: 'secret', subdomain: 'uuid-subdomain'", + "type: acme_dns, server_url: 'https://auth.example.com', username: 'user1', password: \"se\\u0007cret\", subdomain: 'uuid-subdomain'", + "type: acme_dns, server_url: 'https://auth.example.com', username: 'user1', password: 'secret', subdomain: 'uuid.subdomain'", + ] { + let yaml = managed_yaml(&state, bad_challenge, "certificate_source: public"); + assert!(compile(&yaml).is_err(), "unexpectedly accepted: {bad_challenge}"); + } +} + #[test] fn managed_directory_urls_reject_http_uri_normalization() { let dir = tempfile::tempdir().unwrap(); diff --git a/src/config/types/quic_client.rs b/src/config/types/quic_client.rs index 962b0b9bf..a3f65331f 100644 --- a/src/config/types/quic_client.rs +++ b/src/config/types/quic_client.rs @@ -2,7 +2,7 @@ use std::{fmt, io}; use serde::{Deserialize, Serialize}; -#[derive(Clone, Deserialize, Serialize)] +#[derive(Clone, PartialEq, Eq, Deserialize, Serialize)] #[serde(transparent)] pub struct Secret(pub String);