Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ classifiers = [
"Topic :: Internet :: WWW/HTTP",
]
dependencies = [
"certifi",
"truststore",
]
dynamic = ["version"]

Expand Down
5 changes: 2 additions & 3 deletions src/ahttpx/_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import typing

import trio
import certifi
import truststore

from ._streams import Stream

Expand Down Expand Up @@ -87,8 +87,7 @@ def __init__(self, ssl_ctx: ssl.SSLContext | None = None):
self._ssl_ctx = self.create_default_context() if ssl_ctx is None else ssl_ctx

def create_default_context(self) -> ssl.SSLContext:
import certifi
return ssl.create_default_context(cafile=certifi.where())
return truststore.SSLContext(ssl.PROTOCOL_TLS_CLIENT)

async def connect(self, host: str, port: int) -> NetworkStream:
"""
Expand Down
5 changes: 3 additions & 2 deletions src/httpx/_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import types
import typing

import truststore

from ._streams import Stream


Expand Down Expand Up @@ -199,8 +201,7 @@ def __init__(self, ssl_ctx: ssl.SSLContext | None = None):
self._ssl_ctx = self.create_default_context() if ssl_ctx is None else ssl_ctx

def create_default_context(self) -> ssl.SSLContext:
import certifi
return ssl.create_default_context(cafile=certifi.where())
return truststore.SSLContext(ssl.PROTOCOL_TLS_CLIENT)

def connect(self, host: str, port: int) -> NetworkStream:
"""
Expand Down