Open Gunni opened 1 year ago
The error message doesn't give too many details as to why the connection is actually failing, this could be improved.
The underlying issue seems to be caused by limited support for TLS1.3 in Microsoft Windows. Looking at the docs you linked^1:
For TLS 1.3, target .NET Framework 4.8 or later.
This project seems to target a much higher .NET version. https://github.com/LAB02-Research/HASS.Agent/blob/08310c474780107f63053cf02ce52f80e49408cb/src/HASS.Agent/HASS.Agent.csproj#L5C15-L5C15
However, it seems that the TLS1.3 configuration is only supported from Windows 11 and Windows Server 2022^2. Other languages and frameworks do support TLS1.3 on earlier platforms as they're not dependent on Schannel SSP.
Instead of connecting insecurely you could lax the minimum supported TLS version on your reverse proxy to TLS1.2. Just to quote a source on this, the IT Security Guidelines for Transport Layer Security from the Dutch National Cyber Security Centre (NCSC) currently state that the use of TLS1.2 is sufficient^3. Make sure to validate that only secure algorithms are allowed.
Is your feature request related to a problem? Please describe. I have a reverse proxy in front of my Home Assistant server. It only allows TLS 1.3.
This applications fails with this error when connecting: Authentication failed because the remote party sent a TLS alert: 'ProtocolVersion'.
Note that the error in the UI is plainly incorrect...
Describe the solution you'd like Follow the Transport Layer Security (TLS) best practices with the .NET Framework. Especially: For TLS 1.3, target .NET Framework 4.8 or later.
Describe alternatives you've considered Connecting insecurely? No thanks.
Additional context Fix the error to be a better error.
Full exception from log