Skip to content

Commit

Permalink
Allow passing an SSLContext instead of creating a new one.
Browse files Browse the repository at this point in the history
  • Loading branch information
dcmeglio committed Dec 29, 2024
1 parent 195718d commit 29e3563
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions xbox/webapi/common/signed_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
A wrapper around httpx' AsyncClient which transparently calculates the "Signature" header.
"""

from ssl import SSLContext
import httpx

from xbox.webapi.common.request_signer import RequestSigner


class SignedSession(httpx.AsyncClient):
def __init__(self, request_signer=None):
super().__init__()
def __init__(self, request_signer=None, ssl_context: SSLContext=None):
super().__init__(verify=ssl_context if ssl_context is not None else True)

self.request_signer = request_signer or RequestSigner()

@classmethod
Expand Down

0 comments on commit 29e3563

Please sign in to comment.