Skip to content
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

ELK M1 devices need OP_LEGACY_SERVER_CONNECT with openssl3+ (HA 2023.5.x+) #92467

Closed
dragonsoul84 opened this issue May 4, 2023 · 14 comments · Fixed by #92560
Closed

ELK M1 devices need OP_LEGACY_SERVER_CONNECT with openssl3+ (HA 2023.5.x+) #92467

dragonsoul84 opened this issue May 4, 2023 · 14 comments · Fixed by #92560
Assignees

Comments

@dragonsoul84
Copy link

The problem

ELK M1 integration was working perfect on the newest release before 2023.5.0. Immediately after updating, entities associated to ELK M1 not responding and integration says it can't connect to the M1. Error in log is listed below.

What version of Home Assistant Core has the issue?

2023.5.0

What was the last working version of Home Assistant Core?

2023.4.6

What type of installation are you running?

Home Assistant OS

Integration causing the issue

ELK-M1 Control

Link to integration documentation on our website

https://www.home-assistant.io/integrations/elkm1/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: elkm1_lib.connection
Source: runner.py:179
First occurred: 12:07:58 AM (2 occurrences)
Last logged: 12:08:29 AM

Error connecting to ElkM1 ([SSL: UNSAFE_LEGACY_RENEGOTIATION_DISABLED] unsafe legacy renegotiation disabled (_ssl.c:1007)). Retrying in 1 seconds
Error connecting to ElkM1 (). Retrying in 2 seconds

Additional information

No response

@home-assistant
Copy link

home-assistant bot commented May 4, 2023

Hey there @gwww, @bdraco, mind taking a look at this issue as it has been labeled with an integration (elkm1) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of elkm1 can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign elkm1 Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


elkm1 documentation
elkm1 source
(message by IssueLinks)

@codyc1515
Copy link
Contributor

I'm facing the same error message with a totally different (custom) integration. I suspect there has been a library update for the SSL libraries used in HA which has caused this. In any case, the actual root cause is the HTTPS server is not that secure.

@dragonsoul84
Copy link
Author

I suspect this is probably the case. I reloaded 2023.4.6 and am still having the same issue, so I guess the ssl libraries weren't under the same snapshot that was created during the update. I did find a minor firmware update for my ethernet device on the M1XEP and am trying it now.

@bdraco
Copy link
Member

bdraco commented May 4, 2023

@bdraco
Copy link
Member

bdraco commented May 4, 2023

Looks like they decided not to back port the option in cpython

python/cpython#89051

@bdraco
Copy link
Member

bdraco commented May 4, 2023

The raw value is 0x4

So

ssl_context.options |= 0x4

@bdraco
Copy link
Member

bdraco commented May 4, 2023

cpython 3.12.0 alpha 4 and later have the new flag

Since it's due to be released in a few months and ha won't likely upgrade for a year or so the flag to turn it off likely won't be available for another year

@bdraco
Copy link
Member

bdraco commented May 4, 2023

I think we are stuck with the horrible hack of using the raw value

@bdraco
Copy link
Member

bdraco commented May 4, 2023

Its the new openssl version that broke this AFAICT

@bdraco
Copy link
Member

bdraco commented May 4, 2023

Can confirm the breakage is openssl related after upgrading my production install's openssl

@bdraco
Copy link
Member

bdraco commented May 4, 2023

breakage is caused by openssl3

@bdraco
Copy link
Member

bdraco commented May 4, 2023

downgrading openssl fixes the issue

@bdraco
Copy link
Member

bdraco commented May 4, 2023

workaround is to connect without secure port.. thats not so great though

@bdraco
Copy link
Member

bdraco commented May 4, 2023

gwww/elkm1#69 will fix it by manually flipping the legacy flag

@bdraco bdraco added the waiting-for-upstream We're waiting for a change upstream label May 4, 2023
@bdraco bdraco changed the title HA 2023.5.0 broke ELK M1 integration ELK M1 devices need OP_LEGACY_SERVER_CONNECT with openssl3+ (HA 2023.5.x+) May 4, 2023
gwww pushed a commit to gwww/elkm1 that referenced this issue May 4, 2023
@bdraco bdraco removed the waiting-for-upstream We're waiting for a change upstream label May 5, 2023
bdraco added a commit that referenced this issue May 5, 2023
@bdraco bdraco mentioned this issue May 5, 2023
20 tasks
balloob pushed a commit that referenced this issue May 5, 2023
balloob pushed a commit that referenced this issue May 5, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jun 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants