Skip to content

Fix ha-ws passing SSL context to plain ws:// connections#2

Open
ksanislo wants to merge 1 commit into
danbuhler:mainfrom
ksanislo:fix/ha-ws-ssl-on-plain-ws
Open

Fix ha-ws passing SSL context to plain ws:// connections#2
ksanislo wants to merge 1 commit into
danbuhler:mainfrom
ksanislo:fix/ha-ws-ssl-on-plain-ws

Conversation

@ksanislo

@ksanislo ksanislo commented Feb 6, 2026

Copy link
Copy Markdown

Summary

  • ha-ws and lovelace-sync unconditionally created an SSL context and passed it to websockets.connect(), which fails when HA_URL uses http:// or ws://
  • Only create and pass the SSL context when the WebSocket URL scheme is wss://

Test plan

  • Verify ha-ws connects successfully with an https:// / wss:// HA_URL
  • Verify ha-ws connects successfully with an http:// / ws:// HA_URL
  • Verify lovelace-sync connects successfully with both URL schemes

🤖 Generated with Claude Code

The connect method unconditionally created an SSL context and passed it
to websockets.connect(), which fails when HA_URL uses http:// or ws://.
Only create and pass the SSL context when the URL scheme is wss://.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ksanislo ksanislo force-pushed the fix/ha-ws-ssl-on-plain-ws branch from 806a10c to 115a31c Compare February 6, 2026 23:27
@tulensrma

Copy link
Copy Markdown

Please merge this PR, solves an actual problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants