net: Add option to temporarily accept certs that failed the handshake.

This commit is contained in:
Josh Matthews 2020-05-29 13:35:43 -04:00
parent 433c154595
commit 6a6662195e
8 changed files with 73 additions and 13 deletions

View file

@ -98,12 +98,16 @@ pub type Connector = HttpsConnector<HttpConnector>;
pub type TlsConfig = SslConnectorBuilder;
#[derive(Clone)]
pub struct ExtraCerts(pub Arc<Mutex<Vec<Vec<u8>>>>);
pub struct ExtraCerts(Arc<Mutex<Vec<Vec<u8>>>>);
impl ExtraCerts {
pub(crate) fn new() -> Self {
Self(Arc::new(Mutex::new(vec![])))
}
pub(crate) fn add(&self, bytes: Vec<u8>) {
self.0.lock().unwrap().push(bytes);
}
}
struct Host(String);