Add CertificateChecks::Automatic option and make it default

It is the same as AcceptInvalidCertificates for now,
but can be replaced with better heuristics later,
such as a database of known providers or TOFU.
This commit is contained in:
Alexander Krotov
2019-09-30 02:25:05 +03:00
parent e222f49c9d
commit b8ca7b1591
2 changed files with 9 additions and 1 deletions

View File

@@ -7,6 +7,7 @@ use crate::error::Error;
#[derive(Debug, FromPrimitive)]
#[repr(i32)]
pub enum CertificateChecks {
Automatic,
Strict,
AcceptInvalidHostnames,
AcceptInvalidCertificates,
@@ -14,7 +15,7 @@ pub enum CertificateChecks {
impl Default for CertificateChecks {
fn default() -> Self {
Self::AcceptInvalidCertificates
Self::Automatic
}
}