|
@@ -84,6 +84,12 @@ pub struct PrfOption {
|
|
|
|
|
|
#[serde(skip_serializing_if = "Option::is_none")]
|
|
#[serde(skip_serializing_if = "Option::is_none")]
|
|
pub update_interval: Option<u64>,
|
|
pub update_interval: Option<u64>,
|
|
|
|
+
|
|
|
|
+ /// for `remote` profile
|
|
|
|
+ /// disable certificate validation
|
|
|
|
+ /// default is `false`
|
|
|
|
+ #[serde(skip_serializing_if = "Option::is_none")]
|
|
|
|
+ pub danger_accept_invalid_certs: Option<bool>,
|
|
}
|
|
}
|
|
|
|
|
|
impl PrfOption {
|
|
impl PrfOption {
|
|
@@ -93,6 +99,7 @@ impl PrfOption {
|
|
a.user_agent = b.user_agent.or(a.user_agent);
|
|
a.user_agent = b.user_agent.or(a.user_agent);
|
|
a.with_proxy = b.with_proxy.or(a.with_proxy);
|
|
a.with_proxy = b.with_proxy.or(a.with_proxy);
|
|
a.self_proxy = b.self_proxy.or(a.self_proxy);
|
|
a.self_proxy = b.self_proxy.or(a.self_proxy);
|
|
|
|
+ a.danger_accept_invalid_certs = b.danger_accept_invalid_certs.or(a.danger_accept_invalid_certs);
|
|
a.update_interval = b.update_interval.or(a.update_interval);
|
|
a.update_interval = b.update_interval.or(a.update_interval);
|
|
Some(a)
|
|
Some(a)
|
|
}
|
|
}
|
|
@@ -170,6 +177,7 @@ impl PrfItem {
|
|
let opt_ref = option.as_ref();
|
|
let opt_ref = option.as_ref();
|
|
let with_proxy = opt_ref.map_or(false, |o| o.with_proxy.unwrap_or(false));
|
|
let with_proxy = opt_ref.map_or(false, |o| o.with_proxy.unwrap_or(false));
|
|
let self_proxy = opt_ref.map_or(false, |o| o.self_proxy.unwrap_or(false));
|
|
let self_proxy = opt_ref.map_or(false, |o| o.self_proxy.unwrap_or(false));
|
|
|
|
+ let accept_invalid_certs = opt_ref.map_or(false, |o| o.danger_accept_invalid_certs.unwrap_or(false));
|
|
let user_agent = opt_ref.and_then(|o| o.user_agent.clone());
|
|
let user_agent = opt_ref.and_then(|o| o.user_agent.clone());
|
|
let update_interval = opt_ref.and_then(|o| o.update_interval);
|
|
let update_interval = opt_ref.and_then(|o| o.update_interval);
|
|
|
|
|
|
@@ -216,6 +224,7 @@ impl PrfItem {
|
|
None => "clash-verge/unknown".to_string(),
|
|
None => "clash-verge/unknown".to_string(),
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+ builder = builder.danger_accept_invalid_certs(accept_invalid_certs);
|
|
builder = builder.user_agent(user_agent.unwrap_or(version));
|
|
builder = builder.user_agent(user_agent.unwrap_or(version));
|
|
|
|
|
|
let resp = builder.build()?.get(url).send().await?;
|
|
let resp = builder.build()?.get(url).send().await?;
|