Skip to content

Commit 388d3eb

Browse files
authored
Merge pull request #15 from ynab/copilot/fix-3a8d857c-64bc-4b69-932a-7c8a1bfe1bfb
Fix SSL certificate verification error by adding certifi as default CA bundle
2 parents 8c29efe + 0209c4c commit 388d3eb

File tree

5 files changed

+20
-4
lines changed

5 files changed

+20
-4
lines changed

poetry.lock

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

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ urllib3 = ">= 1.25.3 < 3.0.0"
1414
python-dateutil = ">= 2.8.2"
1515
pydantic = ">= 2"
1616
typing-extensions = ">= 4.7.1"
17+
certifi = ">= 14.05.14"
1718

1819
[tool.poetry.group.dev.dependencies]
1920
pytest = ">= 7.2.1"

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ urllib3 >= 2.1.0, < 3.0.0
22
python_dateutil >= 2.8.2
33
pydantic >= 2
44
typing-extensions >= 4.7.1
5+
certifi >= 14.05.14

templates/configuration.mustache

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict, Unio
1414
from typing_extensions import NotRequired, Self
1515

1616
import urllib3
17+
import certifi
1718

1819
{{#hasHttpSignatureMethods}}
1920
from {{packageName}}.signing import HttpSigningConfiguration
@@ -370,7 +371,7 @@ conf = {{{packageName}}}.Configuration(
370371
Set this to false to skip verifying SSL certificate when calling API
371372
from https server.
372373
"""
373-
self.ssl_ca_cert = ssl_ca_cert
374+
self.ssl_ca_cert = ssl_ca_cert if ssl_ca_cert is not None else certifi.where()
374375

375376
"""Set this to verify the peer using PEM (str) or DER (bytes)
376377
certificate data.

ynab/configuration.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from typing_extensions import NotRequired, Self
2323

2424
import urllib3
25+
import certifi
2526

2627

2728
JSON_SCHEMA_VALIDATION_KEYWORDS = {
@@ -256,7 +257,7 @@ def __init__(
256257
Set this to false to skip verifying SSL certificate when calling API
257258
from https server.
258259
"""
259-
self.ssl_ca_cert = ssl_ca_cert
260+
self.ssl_ca_cert = ssl_ca_cert if ssl_ca_cert is not None else certifi.where()
260261

261262
"""Set this to verify the peer using PEM (str) or DER (bytes)
262263
certificate data.

0 commit comments

Comments
 (0)