Skip to content

Commit 069e6bf

Browse files
committed
Merge branch 'feat/use_truststore' into 'main'
feat: Use system TLS certificate store when available (py3.10 or newer) Closes PACMAN-1076 See merge request espressif/idf-component-manager!492
2 parents 028219c + f798da9 commit 069e6bf

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

idf_component_manager/core.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from ruamel.yaml import YAML, CommentedMap
2121

2222
from idf_component_manager.utils import ComponentSource, VersionSolverResolution
23-
from idf_component_tools import ComponentManagerSettings
23+
from idf_component_tools import ComponentManagerSettings, debug
2424
from idf_component_tools.archive_tools import pack_archive, unpack_archive
2525
from idf_component_tools.build_system_tools import build_name, is_component
2626
from idf_component_tools.config import root_managed_components_dir
@@ -88,6 +88,17 @@
8888
from .local_component_list import parse_component_list
8989
from .sync import sync_components
9090

91+
try:
92+
import truststore
93+
94+
truststore.inject_into_ssl()
95+
debug('Use truststore as a source of trusted certificates')
96+
except ImportError:
97+
debug(
98+
'Failed to import truststore, '
99+
"the 'certifi' package will be used as a source of trusted certificates"
100+
)
101+
91102
CHECK_INTERVAL = 3
92103
MAX_PROGRESS = 100 # Expected progress is in percent
93104

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ dependencies = [
4848
"pydantic-core",
4949
"pydantic-settings",
5050
"typing-extensions; python_version < '3.12'",
51+
"truststore; python_version >= '3.10'"
5152
]
5253

5354
[project.optional-dependencies]

0 commit comments

Comments
 (0)