diff --git a/crunchy-cli-core/src/lib.rs b/crunchy-cli-core/src/lib.rs index 4571337..c0cfce5 100644 --- a/crunchy-cli-core/src/lib.rs +++ b/crunchy-cli-core/src/lib.rs @@ -167,7 +167,21 @@ async fn create_ctx(cli: &Cli) -> Result { // TODO: Use crunchy.client() when it's possible // currently crunchy.client() has a cloudflare bypass built-in to access crunchyroll. the servers // where crunchy stores their videos can't handle this bypass and simply refuses to connect + #[cfg(not(all(windows, target_env = "msvc")))] let client = isahc::HttpClient::new().unwrap(); + #[cfg(all(windows, target_env = "msvc"))] + let client = isahc::HttpClientBuilder::default() + .proxy_tls_config( + isahc::tls::TlsConfigBuilder::default().root_cert_store( + isahc::tls::RootCertStore::custom( + rustls_native_certs::load_native_certs() + .unwrap() + .into_iter() + .map(|l| isahc::tls::Certificate::from_der(l.0)), + ), + ), + ) + .build(); Ok(Context { crunchy, client }) }