diff --git a/crates/bevy_asset/Cargo.toml b/crates/bevy_asset/Cargo.toml index b4797dd4c8a7d..7c3c25cf29b68 100644 --- a/crates/bevy_asset/Cargo.toml +++ b/crates/bevy_asset/Cargo.toml @@ -15,7 +15,7 @@ file_watcher = ["notify-debouncer-full", "watch", "multi_threaded"] embedded_watcher = ["file_watcher"] multi_threaded = ["bevy_tasks/multi_threaded"] http = ["blocking", "ureq"] -https = ["blocking", "ureq", "ureq/rustls"] +https = ["blocking", "ureq", "ureq/rustls", "ureq/platform-verifier"] web_asset_cache = [] asset_processor = [] watch = [] diff --git a/crates/bevy_asset/src/io/web.rs b/crates/bevy_asset/src/io/web.rs index 20aaafd20e8c7..15a684dadbc6a 100644 --- a/crates/bevy_asset/src/io/web.rs +++ b/crates/bevy_asset/src/io/web.rs @@ -138,9 +138,19 @@ async fn get(path: PathBuf) -> Result, AssetReaderError> { if let Some(data) = web_asset_cache::try_load_from_cache(str_path).await? { return Ok(Box::new(VecReader::new(data))); } + use ureq::tls::{RootCerts, TlsConfig}; use ureq::Agent; - static AGENT: LazyLock = LazyLock::new(|| Agent::config_builder().build().new_agent()); + static AGENT: LazyLock = LazyLock::new(|| { + Agent::config_builder() + .tls_config( + TlsConfig::builder() + .root_certs(RootCerts::PlatformVerifier) + .build(), + ) + .build() + .new_agent() + }); let uri = str_path.to_owned(); // Use [`unblock`] to run the http request on a separately spawned thread as to not block bevy's