Skip to content

Commit a418153

Browse files
authored
Test on Windows and macOS
1 parent f6426db commit a418153

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

.github/workflows/ci.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,7 @@ jobs:
3838
fail-fast: false
3939
matrix:
4040
os: [macos-latest, windows-latest, ubuntu-latest]
41-
python-version: ["3.10", "3.11", "3.12", "pypy3.10"]
42-
include:
43-
- os: ubuntu-latest
44-
python-version: "3.13"
41+
python-version: ["3.10", "3.11", "3.12", "3.13", "pypy3.10"]
4542

4643
runs-on: ${{ matrix.os }}
4744
name: ${{ fromJson('{"macos-latest":"macOS","windows-latest":"Windows","ubuntu-latest":"Ubuntu"}')[matrix.os] }} Python ${{ matrix.python-version }}

dev-requirements.txt

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ urllib3
77
requests
88
flaky
99
httpx
10+
trustme
1011

11-
# Requires 'cryptography' which doesn't yet support Python 3.13
12-
trustme; python_version < "3.13"
12+
# Temporary stop-gap until cffi supports 3.13
13+
cffi @ https://github.com/python-cffi/cffi/archive/refs/heads/main.zip; python_version > "3.12"

src/truststore/_api.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import sys
66
import typing
77

8+
import _ssl # type: ignore[import-not-found]
9+
810
from ._ssl_constants import (
911
_original_SSLContext,
1012
_original_super_SSLContext,
@@ -279,10 +281,12 @@ def verify_mode(self, value: ssl.VerifyMode) -> None:
279281

280282
def _get_unverified_chain_bytes(sslobj: ssl.SSLObject) -> list[bytes]:
281283
unverified_chain = sslobj.get_unverified_chain() or () # type: ignore[attr-defined]
282-
return [cert for cert in unverified_chain]
284+
return [
285+
cert if isinstance(cert, bytes) else cert.public_bytes(_ssl.ENCODING_DER)
286+
for cert in unverified_chain
287+
]
283288

284289
else:
285-
import _ssl # type: ignore[import-not-found]
286290

287291
def _get_unverified_chain_bytes(sslobj: ssl.SSLObject) -> list[bytes]:
288292
unverified_chain = sslobj.get_unverified_chain() or () # type: ignore[attr-defined]

0 commit comments

Comments
 (0)