diff --git a/docs/iamb.5 b/docs/iamb.5 index 8357f965..5134b8a9 100644 --- a/docs/iamb.5 +++ b/docs/iamb.5 @@ -241,6 +241,10 @@ Defaults to 30. .It Sy tabstop Number of spaces that a counts for. Defaults to 4. + +.It Sy ssl_verify +Enable SSL verification for the HTTP requests. +Defaults to true. .El .Ss Example 1: Avoid showing Emojis (useful for terminals w/o support) diff --git a/src/config.rs b/src/config.rs index e7a4a47b..7843bf73 100644 --- a/src/config.rs +++ b/src/config.rs @@ -581,6 +581,7 @@ pub struct TunableValues { pub user_gutter_width: usize, pub external_edit_file_suffix: String, pub tabstop: usize, + pub ssl_verify: bool, } #[derive(Clone, Default, Deserialize)] @@ -609,6 +610,7 @@ pub struct Tunables { pub user_gutter_width: Option, pub external_edit_file_suffix: Option, pub tabstop: Option, + pub ssl_verify: Option, } impl Tunables { @@ -643,6 +645,7 @@ impl Tunables { .external_edit_file_suffix .or(other.external_edit_file_suffix), tabstop: self.tabstop.or(other.tabstop), + ssl_verify: self.ssl_verify.or(other.ssl_verify), } } @@ -673,6 +676,7 @@ impl Tunables { .external_edit_file_suffix .unwrap_or_else(|| ".md".to_string()), tabstop: self.tabstop.unwrap_or(4), + ssl_verify: self.ssl_verify.unwrap_or(true), } } } diff --git a/src/tests.rs b/src/tests.rs index e9b05021..43ef5123 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -202,6 +202,7 @@ pub fn mock_tunables() -> TunableValues { image_preview: None, user_gutter_width: 30, tabstop: 4, + ssl_verify: true, } } diff --git a/src/worker.rs b/src/worker.rs index f3c9791a..a38376a1 100644 --- a/src/worker.rs +++ b/src/worker.rs @@ -717,6 +717,7 @@ async fn create_client_inner( .pool_idle_timeout(Duration::from_secs(60)) .pool_max_idle_per_host(10) .tcp_keepalive(Duration::from_secs(10)) + .danger_accept_invalid_certs(!settings.tunables.ssl_verify) .build() .unwrap();