Skip to content

Commit aaaf82c

Browse files
authored
Turbopack: Suggest using system certs when a TLS error occurs (#85009)
We don't really want to document this flag because 99% of developers won't need it, but we can detect this situation and suggest the flag. Based on this user getting stuck: https://x.com/_bgwoodruff/status/1978493219068371330
1 parent fb106d5 commit aaaf82c

File tree

10 files changed

+315
-122
lines changed

10 files changed

+315
-122
lines changed

Cargo.lock

Lines changed: 73 additions & 58 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ rand = "0.9.0"
414414
rayon = "1.10.0"
415415
regex = "1.10.6"
416416
regress = "0.10.4"
417-
reqwest = { version = "0.12.22", default-features = false }
417+
reqwest = { version = "0.12.24", default-features = false }
418418
ringmap = "0.1.3"
419419
roaring = "0.10.10"
420420
rstest = "0.16.0"
@@ -451,7 +451,7 @@ urlencoding = "2.1.2"
451451
uuid = "1.18.1"
452452
vergen = { version = "9.0.6", features = ["cargo"] }
453453
vergen-gitcl = { version = "1.0.8", features = ["cargo"] }
454-
webbrowser = "0.8.7"
454+
webbrowser = "1.0.6"
455455
inventory = "0.3.21"
456456

457457
[patch.crates-io]

crates/next-core/src/next_config.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use turbo_tasks::{
1010
trace::TraceRawVcs,
1111
};
1212
use turbo_tasks_env::{EnvMap, ProcessEnv};
13-
use turbo_tasks_fetch::FetchClient;
13+
use turbo_tasks_fetch::FetchClientConfig;
1414
use turbo_tasks_fs::FileSystemPath;
1515
use turbopack::module_options::{
1616
ConditionItem, ConditionPath, LoaderRuleItem, WebpackRules,
@@ -1914,7 +1914,10 @@ impl NextConfig {
19141914
}
19151915

19161916
#[turbo_tasks::function]
1917-
pub async fn fetch_client(&self, env: Vc<Box<dyn ProcessEnv>>) -> Result<Vc<FetchClient>> {
1917+
pub async fn fetch_client(
1918+
&self,
1919+
env: Vc<Box<dyn ProcessEnv>>,
1920+
) -> Result<Vc<FetchClientConfig>> {
19181921
// Support both an env var and the experimental flag to provide more flexibility to
19191922
// developers on locked down systems, depending on if they want to configure this on a
19201923
// per-system or per-project basis.
@@ -1928,7 +1931,7 @@ impl NextConfig {
19281931
})
19291932
.or(self.experimental.turbopack_use_system_tls_certs)
19301933
.unwrap_or(false);
1931-
Ok(FetchClient {
1934+
Ok(FetchClientConfig {
19321935
tls_built_in_webpki_certs: !use_system_tls_certs,
19331936
tls_built_in_native_certs: use_system_tls_certs,
19341937
}

crates/next-core/src/next_font/google/mod.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use turbo_rcstr::{RcStr, rcstr};
1010
use turbo_tasks::{Completion, FxIndexMap, ResolvedVc, Vc};
1111
use turbo_tasks_bytes::stream::SingleValue;
1212
use turbo_tasks_env::{CommandLineProcessEnv, ProcessEnv};
13-
use turbo_tasks_fetch::{FetchClient, HttpResponseBody};
13+
use turbo_tasks_fetch::{FetchClientConfig, HttpResponseBody};
1414
use turbo_tasks_fs::{
1515
DiskFileSystem, File, FileContent, FileSystem, FileSystemPath,
1616
json::parse_json_with_source_context,
@@ -183,7 +183,7 @@ pub struct NextFontGoogleCssModuleReplacer {
183183
project_path: FileSystemPath,
184184
execution_context: ResolvedVc<ExecutionContext>,
185185
next_mode: ResolvedVc<NextMode>,
186-
fetch_client: ResolvedVc<FetchClient>,
186+
fetch_client: ResolvedVc<FetchClientConfig>,
187187
}
188188

189189
#[turbo_tasks::value_impl]
@@ -193,7 +193,7 @@ impl NextFontGoogleCssModuleReplacer {
193193
project_path: FileSystemPath,
194194
execution_context: ResolvedVc<ExecutionContext>,
195195
next_mode: ResolvedVc<NextMode>,
196-
fetch_client: ResolvedVc<FetchClient>,
196+
fetch_client: ResolvedVc<FetchClientConfig>,
197197
) -> Vc<Self> {
198198
Self::cell(NextFontGoogleCssModuleReplacer {
199199
project_path,
@@ -376,13 +376,16 @@ struct NextFontGoogleFontFileOptions {
376376
#[turbo_tasks::value(shared)]
377377
pub struct NextFontGoogleFontFileReplacer {
378378
project_path: FileSystemPath,
379-
fetch_client: ResolvedVc<FetchClient>,
379+
fetch_client: ResolvedVc<FetchClientConfig>,
380380
}
381381

382382
#[turbo_tasks::value_impl]
383383
impl NextFontGoogleFontFileReplacer {
384384
#[turbo_tasks::function]
385-
pub fn new(project_path: FileSystemPath, fetch_client: ResolvedVc<FetchClient>) -> Vc<Self> {
385+
pub fn new(
386+
project_path: FileSystemPath,
387+
fetch_client: ResolvedVc<FetchClientConfig>,
388+
) -> Vc<Self> {
386389
Self::cell(NextFontGoogleFontFileReplacer {
387390
project_path,
388391
fetch_client,
@@ -670,7 +673,7 @@ fn font_file_options_from_query_map(query: &RcStr) -> Result<NextFontGoogleFontF
670673
}
671674

672675
async fn fetch_real_stylesheet(
673-
fetch_client: Vc<FetchClient>,
676+
fetch_client: Vc<FetchClientConfig>,
674677
stylesheet_url: RcStr,
675678
css_virtual_path: FileSystemPath,
676679
) -> Result<Option<Vc<RcStr>>> {
@@ -680,7 +683,7 @@ async fn fetch_real_stylesheet(
680683
}
681684

682685
async fn fetch_from_google_fonts(
683-
fetch_client: Vc<FetchClient>,
686+
fetch_client: Vc<FetchClientConfig>,
684687
url: RcStr,
685688
virtual_path: FileSystemPath,
686689
) -> Result<Option<Vc<HttpResponseBody>>> {

0 commit comments

Comments
 (0)