aboutsummaryrefslogtreecommitdiff
path: root/src/reverse_proxy.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-12-09 12:18:23 +0100
committerAlex Auvolat <alex@adnab.me>2021-12-09 12:18:23 +0100
commitfdb83162ce9979184a9d680c5ec4f64235497485 (patch)
tree543d1d0b7c8f63d7a10c38d1d95c8b2e2c8a180f /src/reverse_proxy.rs
parent8153bdca4618eed76665eeb4c5a005378701df1f (diff)
downloadtricot-fdb83162ce9979184a9d680c5ec4f64235497485.tar.gz
tricot-fdb83162ce9979184a9d680c5ec4f64235497485.zip
Improved management of ACME orders and certificate pre-expiration period
Diffstat (limited to 'src/reverse_proxy.rs')
-rw-r--r--src/reverse_proxy.rs26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/reverse_proxy.rs b/src/reverse_proxy.rs
index 10f463c..7b0f261 100644
--- a/src/reverse_proxy.rs
+++ b/src/reverse_proxy.rs
@@ -1,11 +1,11 @@
//! Copied from https://github.com/felipenoris/hyper-reverse-proxy
//! See there for original Copyright notice
-use std::sync::Arc;
use std::convert::TryInto;
-use std::time::SystemTime;
use std::net::IpAddr;
use std::str::FromStr;
+use std::sync::Arc;
+use std::time::SystemTime;
use anyhow::Result;
use log::*;
@@ -13,9 +13,9 @@ use log::*;
use http::header::HeaderName;
use hyper::header::{HeaderMap, HeaderValue};
use hyper::{Body, Client, Request, Response, Uri};
-use rustls::{Certificate, ServerName};
-use rustls::client::{ServerCertVerifier, ServerCertVerified};
use lazy_static::lazy_static;
+use rustls::client::{ServerCertVerified, ServerCertVerifier};
+use rustls::{Certificate, ServerName};
use crate::tls_util::HttpsConnectorFixedDnsname;
@@ -175,16 +175,14 @@ struct DontVerifyServerCert;
impl ServerCertVerifier for DontVerifyServerCert {
fn verify_server_cert(
- &self,
- _end_entity: &Certificate,
- _intermediates: &[Certificate],
- _server_name: &ServerName,
- _scts: &mut dyn Iterator<Item = &[u8]>,
- _ocsp_response: &[u8],
- _now: SystemTime
- ) -> Result<ServerCertVerified, rustls::Error> {
+ &self,
+ _end_entity: &Certificate,
+ _intermediates: &[Certificate],
+ _server_name: &ServerName,
+ _scts: &mut dyn Iterator<Item = &[u8]>,
+ _ocsp_response: &[u8],
+ _now: SystemTime,
+ ) -> Result<ServerCertVerified, rustls::Error> {
Ok(ServerCertVerified::assertion())
}
}
-
-