-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable ssl VERIFY_X509_STRICT with self-signed certificate DNS #737
Conversation
The new flag enforced in Python 3.13 with python/cpython#107361 doesn't work with the semi broken Freebox self signed certificates. It should fix home-assistant/core#132333 Fixes hacf-fr#734
For me, this doesn't solve the problem described in home-assistant/core#132333. I had to disable certificate verification:
|
It's surprising. There is no reason for the SSL verification to work in python 3.12 and to start failing suddenly with 3.13. The main thing that changed with 3.13 is the 2 additional flags. Can you try disabling |
I tried to disable only VERIFY_X509_PARTIAL_CHAIN , but it didn't solve the problem. |
OK I'm not sure what's going on. I can confirm that this PR works for me with a Delta. |
Currently testing on Revolution |
@olivierh65 : what Freebox model, Freebox firmware version and Python version do you have ? |
From py3.11: OK ✅
To py3.13 after your PR: OK ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and working, thanks !
Co-authored-by: Quentame <[email protected]>
I have the same issue on Freebox Delta. These are my configs: Python version = 3.13 and from : http://mafreebox.freebox.fr/api_version I get :
@Quentame How can I test your PR, pls? |
On my side :
{"box_model_name":"Freebox Server (r2)","api_base_url":"\/api\/","https_port":0000pp,"device_name":"Freebox Server","https_available":true,"box_model":"fbxgw-r2\/full","api_domain":"llllllllll.fbxos.fr","api_version":"12.2","device_type":"FreeboxServer1,2"}
If you create a new domain with a let's crypt certificat, and use this domain to connect the plug-in, it should work.
|
By running this file
What I wrote there home-assistant/core#132333 (comment) 😉 |
Yes, it was just a confirmation |
@@ -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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think an host.endswith(".fboxos.fr")
and host = "mafreebox.freebox.fr"
would be safer.
The new flag enforced in Python 3.13 with
python/cpython#107361 doesn't work with the semi broken Freebox self signed certificates.
It should fix home-assistant/core#132333
Fixes #734