mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 04:02:00 -06:00
Use system certs when using openssl
This commit is contained in:
parent
3ae6fe4a1a
commit
18f891efd2
3 changed files with 77 additions and 11 deletions
|
|
@ -271,7 +271,17 @@ async fn crunchyroll_session(cli: &mut Cli) -> Result<Crunchyroll> {
|
|||
CrunchyrollBuilder::predefined_client_builder()
|
||||
};
|
||||
#[cfg(any(feature = "openssl", feature = "openssl-static"))]
|
||||
let client = builder.use_native_tls().build().unwrap();
|
||||
let client = {
|
||||
let mut builder = builder.use_native_tls().tls_built_in_root_certs(false);
|
||||
|
||||
for certificate in rustls_native_certs::load_native_certs().unwrap() {
|
||||
builder = builder.add_root_certificate(
|
||||
reqwest::Certificate::from_der(certificate.0.as_slice()).unwrap(),
|
||||
)
|
||||
}
|
||||
|
||||
builder.build().unwrap()
|
||||
};
|
||||
#[cfg(not(any(feature = "openssl", feature = "openssl-static")))]
|
||||
let client = builder.build().unwrap();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue