Skip to content

Commit

Permalink
Disable ssl VERIFY_X509_STRICT with self-signed certificate DNS (#737)
Browse files Browse the repository at this point in the history
Co-authored-by: Quentame <[email protected]>
  • Loading branch information
therve and Quentame authored Dec 17, 2024
1 parent 0bebed9 commit 8b2a0d2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/freebox_api/aiofreepybox.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ async def open(self, host: str, port: str) -> None:
cert_path = os.path.join(os.path.dirname(__file__), "freebox_certificates.pem")
ssl_ctx = ssl.create_default_context()
ssl_ctx.load_verify_locations(cafile=cert_path)
if ".fbxos.fr" in host or "mafreebox.freebox.fr" in host:
# Disable strict validating introduced in Python 3.13, which doesn't
# work with default Freebox certificates
ssl_ctx.verify_flags &= ~ssl.VERIFY_X509_STRICT

conn = TCPConnector(ssl_context=ssl_ctx)
self._session = ClientSession(connector=conn)
Expand Down

0 comments on commit 8b2a0d2

Please sign in to comment.