diff --git a/Cargo.toml b/Cargo.toml index b6f1add..250d058 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "crunchyroll-rs" -version = "0.8.6" +version = "0.9.0" authors = ["Crunchy Labs Maintainers"] edition = "2021" description = "Pure Rust implementation of the crunchyroll api." @@ -28,11 +28,11 @@ async-trait = "0.1" chrono = { version = ">=0.4.35", features = ["serde"] } dash-mpd = { version = "0.15", default-features = false } futures-util = { version = "0.3", features = ["std"], default-features = false } -jsonwebtoken = { version = "9.2", default-features = false } +jsonwebtoken = { version = "9.3", default-features = false } # the patch version number is necessary for the 'reqwest' and 'rustls' dependencies to prevent incompatability errors # (https://github.com/seanmonstar/reqwest/issues/1837) -reqwest = { version = "0.11.25", features = ["cookies", "json", "multipart", "rustls-tls"], default-features = false } -rustls = { version = "0.21.6", features = ["dangerous_configuration"] } +reqwest = { version = "0.12.1", features = ["cookies", "json", "multipart", "rustls-tls"], default-features = false } +rustls = "0.22.2" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" serde_urlencoded = "0.7" @@ -40,7 +40,7 @@ smart-default = "0.7" tokio = { version = "1.36", features = ["sync"] } webpki-roots = "0.26" -crunchyroll-rs-internal = { version = "0.8.6", path = "internal" } +crunchyroll-rs-internal = { version = "0.9.0", path = "internal" } lazy_static = { version = "1.4", optional = true } regex = { version = "1.10", default-features = false, features = ["std"], optional = true } diff --git a/internal/Cargo.toml b/internal/Cargo.toml index 2b6b05e..ecc5e77 100644 --- a/internal/Cargo.toml +++ b/internal/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "crunchyroll-rs-internal" -version = "0.8.6" +version = "0.9.0" authors = ["Crunchy Labs Maintainers"] edition = "2021" description = "Internal crate for crunchyroll-rs. Do not use." diff --git a/src/crunchyroll.rs b/src/crunchyroll.rs index 0e13841..d4c0c4e 100644 --- a/src/crunchyroll.rs +++ b/src/crunchyroll.rs @@ -608,21 +608,20 @@ mod auth { /// to configure the behavior of the download client. Use [`CrunchyrollBuilder::client`] or /// to set your built client. pub fn predefined_client_builder() -> ClientBuilder { - let mut root_store = rustls::RootCertStore::empty(); - root_store.add_trust_anchors(webpki_roots::TLS_SERVER_ROOTS.iter().map(|ta| { - rustls::OwnedTrustAnchor::from_subject_spki_name_constraints( - ta.subject.to_vec(), - ta.subject_public_key_info.to_vec(), - ta.name_constraints.clone().map(|nc| nc.to_vec()), - ) - })); - let tls_config = rustls::ClientConfig::builder() - .with_cipher_suites(rustls::DEFAULT_CIPHER_SUITES) - .with_kx_groups(&[&rustls::kx_group::X25519]) - .with_protocol_versions(&[&rustls::version::TLS12, &rustls::version::TLS13]) - .unwrap() - .with_root_certificates(root_store) - .with_no_client_auth(); + let tls_config = rustls::ClientConfig::builder_with_provider( + rustls::crypto::CryptoProvider { + cipher_suites: rustls::crypto::ring::DEFAULT_CIPHER_SUITES.to_vec(), + kx_groups: vec![rustls::crypto::ring::kx_group::X25519], + ..rustls::crypto::ring::default_provider() + } + .into(), + ) + .with_protocol_versions(&[&rustls::version::TLS12, &rustls::version::TLS13]) + .unwrap() + .with_root_certificates(rustls::RootCertStore { + roots: webpki_roots::TLS_SERVER_ROOTS.into(), + }) + .with_no_client_auth(); Client::builder() .https_only(true)