Skip to content

Commit 29e3563

Browse files
committed
Allow passing an SSLContext instead of creating a new one.
1 parent 195718d commit 29e3563

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

xbox/webapi/common/signed_session.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@
33
A wrapper around httpx' AsyncClient which transparently calculates the "Signature" header.
44
"""
55

6+
from ssl import SSLContext
67
import httpx
78

89
from xbox.webapi.common.request_signer import RequestSigner
910

1011

1112
class SignedSession(httpx.AsyncClient):
12-
def __init__(self, request_signer=None):
13-
super().__init__()
13+
def __init__(self, request_signer=None, ssl_context: SSLContext=None):
14+
super().__init__(verify=ssl_context if ssl_context is not None else True)
15+
1416
self.request_signer = request_signer or RequestSigner()
1517

1618
@classmethod

0 commit comments

Comments
 (0)