Skip to content

Commit 2944df8

Browse files
committed
Add configurable SSL certificate validation bypass
Allows disabling SSL certificate validation for HTTP clients by setting the `ACCEPT_INVALID_CERTS` environment variable. This is useful when working with self-signed certificates on stream servers that may not have properly configured SSL certificates. The feature is opt-in and only activates when the environment variable is explicitly set.
1 parent 5e788f2 commit 2944df8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/stream_servers/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::any::Any;
1+
use std::{any::Any, env};
22

33
use async_trait::async_trait;
44
use serde::{Deserialize, Serialize};
@@ -93,6 +93,7 @@ static APP_USER_AGENT: &str = concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_P
9393
fn default_reqwest_client() -> reqwest::Client {
9494
reqwest::Client::builder()
9595
.user_agent(APP_USER_AGENT)
96+
.danger_accept_invalid_certs(env::var("ACCEPT_INVALID_CERTS").is_ok())
9697
.build()
9798
.expect("Failed to create reqwest client")
9899
}

0 commit comments

Comments
 (0)