From 290c2626d1cadf66b9bb6ca2fa75dc00014dd5f1 Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Fri, 25 Sep 2020 03:43:26 -0600 Subject: [PATCH] preserve client certs --- Cargo.toml | 2 +- src/server/mod.rs | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ad93477..0afa491 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ repository = "https://tulpa.dev/cadey/maj" [dependencies] async-std = { version = "1.6", optional = true } -async-tls = { default-features = false, optional = true, version = "0" } +async-tls = { default-features = false, optional = true, version = "0", git = "https://github.com/FlorianUekermann/async-tls.git" } async-trait = { version = "0", optional = true } log = "0.4" mime_guess = "2.0" diff --git a/src/server/mod.rs b/src/server/mod.rs index 5562919..2eb87c2 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -102,10 +102,14 @@ async fn handle_request( Err(RequestParsingError::InvalidScheme(url.scheme().to_string()))? } + let certs = stream + .peer_certificates() + .map(|certs| certs.into_iter().map(Certificate).collect()); + let req = Request { url: url, addr: addr, - certs: None, + certs: certs, }; handle(h, req, &mut stream, addr).await; }