Skip to content

Starscream.HTTPUpgradeError #3618

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

Open
charlespick opened this issue May 26, 2025 · 0 comments
Open

Starscream.HTTPUpgradeError #3618

charlespick opened this issue May 26, 2025 · 0 comments

Comments

@charlespick
Copy link

Model Name: 2 iPhone models, 1 iPad
Software Version: iOS 18.5
App version: Latest as of 5/26/2025 (can't get into the app to check, re downloaded from App Store)

Home Assistant Core Version
2025.5.1

Describe the bug
App is not using secure HTTP for the websocket upgrade when adding a new server.
"We couldn't connect to Home Assistant"
Starscream.HTTPUpgradeError

To Reproduce
Add a new server using the HTTPS scheme

Expected behavior
App connects using secure HTTP for all API calls, including the websocket upgrade

Additional context
I specify https://servername/ when adding the server but:
In nginx access log, I see 301 redirects to HTTPS on the /api/websocket endpoint
In the app I get a Starscream.HTTPUpgradeError
In the exported app logs I see
[Error] [main] [Environment.swift:75] init() > WebSocket: Error: Optional(Starscream.HTTPUpgradeError.notAnUpgrade(301, ["Server": "nginx/1.26.3 (Ubuntu)", "Content-Type": "text/html", "Date": "Mon, 26 May 2025 03:17:41 GMT", "Connection": "keep-alive", "Location": "https://dev-hass.makerland.xyz/api/websocket", "Content-Length": "178"]))
With TCPdump I see traffic going to port 80
04:05:09.417593 eth0 In IP 10.3.5.140.52083 > hass02.makerland.xyz.http: Flags [S], seq 600926463, win 65535, options [mss 1460,nop,wscale 6,nop,nop,TS val 4049053127 ecr 0,sackOK,eol], length 0
In the configuration.yaml, I've defined the URLs with HTTPS also. HTTP isn't mentioned anywhere but starscream is trying to connect via insecure websocket. Not sure if that makes it a bug better suited for the starscream repo. I can't tell if it's a bug in the implementation of the library or the lib itself. Swift is up there with the programming languages that confuse me the most.
I can connect just fine in Safari. Right now I have the webpage added to my homescreen.

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

No branches or pull requests

1 participant