Skip to content

Commit 249abfd

Browse files
PLAT-10643: Load certs from system store
In finos#122 we enable loading a custom cert store for the HTTP client. This broked using pods with valid certs because the system certs are no longer loaded. This change loads them even all the time (and we might add custom ones on top of that). Also sync the rest.mustache template used for code generation.
1 parent 45756aa commit 249abfd

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

symphony/bdk/gen/rest.py

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ def __init__(self, configuration, pools_size=4, maxsize=None):
4949
maxsize = configuration.connection_pool_maxsize
5050

5151
ssl_context = ssl.create_default_context(purpose=ssl.Purpose.CLIENT_AUTH, cafile=configuration.ssl_ca_cert)
52+
ssl_context.load_default_certs()
5253
ssl_context.verify_mode = ssl.CERT_REQUIRED
5354

5455
if configuration.cert_file:

templates/rest.mustache

+4-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ class RESTClientObject(object):
4040
if maxsize is None:
4141
maxsize = configuration.connection_pool_maxsize
4242

43-
ssl_context = ssl.create_default_context(cafile=configuration.ssl_ca_cert)
43+
ssl_context = ssl.create_default_context(purpose=ssl.Purpose.CLIENT_AUTH, cafile=configuration.ssl_ca_cert)
44+
ssl_context.load_default_certs()
45+
ssl_context.verify_mode = ssl.CERT_REQUIRED
46+
4447
if configuration.cert_file:
4548
ssl_context.load_cert_chain(
4649
configuration.cert_file, keyfile=configuration.key_file

0 commit comments

Comments
 (0)