Skip to content

Commit

Permalink
fix: SSL verification for any DNS (#760)
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentame authored Jan 9, 2025
1 parent 0de632b commit 39735aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ readme = "README.rst"
homepage = "https://github.com/hacf-fr/freebox-api"
repository = "https://github.com/hacf-fr/freebox-api"
documentation = "https://freebox-api.readthedocs.io"
keywords=["freebox"]
keywords=["freebox", "iliadbox"]
classifiers = [
"Operating System :: OS Independent",
"Development Status :: 5 - Production/Stable",
Expand Down
7 changes: 3 additions & 4 deletions src/freebox_api/aiofreepybox.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,9 @@ async def open(self, host: str, port: str) -> None:
cert_path = path.join(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
# Disable strict validation introduced in Python 3.13, which doesn't
# work with Freebox/iliadbox self-signed gateway 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 39735aa

Please sign in to comment.