fix: allow invalid certs

This commit is contained in:
2025-03-08 18:31:44 +00:00
parent 8c3756e3e8
commit 9606b91e6d
3 changed files with 7 additions and 4 deletions

View File

@ -11,11 +11,14 @@ pub struct JsonApi {
}
impl JsonApi {
pub fn token(base: &str, token: &str) -> anyhow::Result<Self> {
pub fn token(base: &str, token: &str, allow_invalid_certs: bool) -> anyhow::Result<Self> {
let mut headers = HeaderMap::new();
headers.insert(AUTHORIZATION, token.parse()?);
let client = Client::builder().default_headers(headers).build()?;
let client = Client::builder()
.danger_accept_invalid_certs(allow_invalid_certs)
.default_headers(headers)
.build()?;
Ok(Self {
client,
base: base.parse()?,