Skip to content

Commit

Permalink
use system trust store by default
Browse files Browse the repository at this point in the history
Signed-off-by: bigcat88 <[email protected]>
  • Loading branch information
bigcat88 committed Jan 19, 2025
1 parent 78a6f76 commit 51dbcc9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nc_py_api/_version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Version of nc_py_api."""

__version__ = "0.18.1"
__version__ = "0.18.2"
12 changes: 11 additions & 1 deletion nc_py_api/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,21 @@
SSL certificates (a.k.a CA bundle) used to verify the identity of requested hosts. Either **True** (default CA bundle),
a path to an SSL certificate file, or **False** (which will disable verification)."""
str_val = environ.get("NPA_NC_CERT", "True")
NPA_NC_CERT = True
# https://github.com/encode/httpx/issues/302
# when "httpx" will switch to use "truststore" by default - uncomment next line
# NPA_NC_CERT = True
if str_val.lower() in ("false", "0"):
NPA_NC_CERT = False
elif str_val.lower() not in ("true", "1"):
NPA_NC_CERT = str_val
else:
# Temporary workaround, see comment above.
# Use system certificate stores

import ssl
import truststore

NPA_NC_CERT = truststore.SSLContext(ssl.PROTOCOL_TLS_CLIENT)

CHUNKED_UPLOAD_V2 = environ.get("CHUNKED_UPLOAD_V2", True)
"""Option to enable/disable **version 2** chunked upload(better Object Storages support).
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ dependencies = [
"pydantic>=2.1.1",
"python-dotenv>=1",
"xmltodict>=0.13",
"truststore==0.10.0",
]
optional-dependencies.app = [
"uvicorn[standard]>=0.23.2",
Expand Down

0 comments on commit 51dbcc9

Please sign in to comment.