Skip to content

Commit 028c087

Browse files
authored
Merge pull request #13195 from ichard26/truststore-hotfix
Don't pass --cert to build subprocesses unless also given on CLI
2 parents f5ff4fa + 519c212 commit 028c087

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

news/13186.bugfix.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix regression where truststore would never be used while installing build dependencies.

src/pip/_internal/build_env.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from types import TracebackType
1212
from typing import TYPE_CHECKING, Iterable, List, Optional, Set, Tuple, Type, Union
1313

14-
from pip._vendor.certifi import where
1514
from pip._vendor.packaging.version import Version
1615

1716
from pip import __file__ as pip_location
@@ -246,8 +245,6 @@ def _install_requirements(
246245
# target from config file or env var should be ignored
247246
"--target",
248247
"",
249-
"--cert",
250-
finder.custom_cert or where(),
251248
]
252249
if logger.getEffectiveLevel() <= logging.DEBUG:
253250
args.append("-vv")
@@ -276,6 +273,8 @@ def _install_requirements(
276273
args.extend(["--proxy", finder.proxy])
277274
for host in finder.trusted_hosts:
278275
args.extend(["--trusted-host", host])
276+
if finder.custom_cert:
277+
args.extend(["--cert", finder.custom_cert])
279278
if finder.client_cert:
280279
args.extend(["--client-cert", finder.client_cert])
281280
if finder.allow_all_prereleases:

0 commit comments

Comments
 (0)