Release 0.5.0

Rename to rups
This commit is contained in:
Aram 🍐 2021-08-01 03:17:17 -04:00
parent 539d11848e
commit feef67255f
21 changed files with 51 additions and 47 deletions

30
rups/src/ssl/mod.rs Normal file
View file

@ -0,0 +1,30 @@
use crate::Config;
/// The certificate validation mechanism that allows any certificate.
pub struct InsecureCertificateValidator {
debug: bool,
}
impl InsecureCertificateValidator {
/// Initialize a new instance.
pub fn new(config: &Config) -> Self {
InsecureCertificateValidator {
debug: config.debug,
}
}
}
impl rustls::ServerCertVerifier for InsecureCertificateValidator {
fn verify_server_cert(
&self,
_roots: &rustls::RootCertStore,
_presented_certs: &[rustls::Certificate],
_dns_name: webpki::DNSNameRef<'_>,
_ocsp: &[u8],
) -> Result<rustls::ServerCertVerified, rustls::TLSError> {
if self.debug {
eprintln!("DEBUG <- (!) Certificate received, but not verified");
}
Ok(rustls::ServerCertVerified::assertion())
}
}