preserve client certs

This commit is contained in:
Melody Horn 2020-09-25 03:43:26 -06:00
parent 85a3cfda4a
commit 290c2626d1
2 changed files with 6 additions and 2 deletions

View File

@ -11,7 +11,7 @@ repository = "https://tulpa.dev/cadey/maj"
[dependencies] [dependencies]
async-std = { version = "1.6", optional = true } 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 } async-trait = { version = "0", optional = true }
log = "0.4" log = "0.4"
mime_guess = "2.0" mime_guess = "2.0"

View File

@ -102,10 +102,14 @@ async fn handle_request(
Err(RequestParsingError::InvalidScheme(url.scheme().to_string()))? Err(RequestParsingError::InvalidScheme(url.scheme().to_string()))?
} }
let certs = stream
.peer_certificates()
.map(|certs| certs.into_iter().map(Certificate).collect());
let req = Request { let req = Request {
url: url, url: url,
addr: addr, addr: addr,
certs: None, certs: certs,
}; };
handle(h, req, &mut stream, addr).await; handle(h, req, &mut stream, addr).await;
} }