Skip to content

Commit 8457b67

Browse files
Copilotbradymholt
andcommitted
Add certifi dependency and use it as default for SSL CA certificates
Co-authored-by: bradymholt <[email protected]>
1 parent 2ee4269 commit 8457b67

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

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)