Fix Sieve: Do not allow invalid certs in http_header function

This commit is contained in:
Maurus Decimus
2026-06-10 15:54:50 +02:00
parent 33f288d0ea
commit 6cfad95dfb
2 changed files with 9 additions and 4 deletions

View File

@@ -11,7 +11,8 @@ If you are upgrading from v0.16.x, replace the binary (or run `docker pull`). If
## Changed ## Changed
## Fixed ## Fixed
- JMAP: `*/changes` methods leak ids of non-shared objects - JMAP: `*/changes` methods leak ids of non-shared objects (reported by @5ud0er).
- Sieve: Do not allow invalid certs in `http_header` function.
## [0.16.8] - 2026-06-06 ## [0.16.8] - 2026-06-06

View File

@@ -26,11 +26,15 @@ pub async fn exec_header(ctx: PluginContext<'_>) -> trc::Result<Variable> {
return Ok(Variable::from(url.split_once("/?").unwrap().1.to_string())); return Ok(Variable::from(url.split_once("/?").unwrap().1.to_string()));
} }
reqwest::Client::builder() let builder = reqwest::Client::builder()
.user_agent(agent.as_ref()) .user_agent(agent.as_ref())
.timeout(Duration::from_millis(timeout)) .timeout(Duration::from_millis(timeout))
.redirect(Policy::none()) .redirect(Policy::none());
.danger_accept_invalid_certs(true)
#[cfg(feature = "test_mode")]
let builder = builder.danger_accept_invalid_certs(true);
builder
.build() .build()
.map_err(|err| { .map_err(|err| {
trc::SieveEvent::RuntimeError trc::SieveEvent::RuntimeError