websocket authentication issue

20 views
Skip to first unread message

Dimitris Dimopoulos

unread,
Feb 3, 2026, 8:25:10 AM (12 days ago) Feb 3
to swupdate
Hello all,

I'm trying to communicate via websocket to swupdate to get a status update of my device being programmed.

swupdate version is 2025.05-

A bit of context:
In my python application i create a websocket and then I am trying to connect to it.
So ws.connect(ws://ip:port)
Before my upload even starts I am getting a 401 error,

File "/usr/local/lib/python3.8/dist-packages/websocket/_handshake.py", line 148, in _get_resp_headers raise WebSocketBadStatusException("Handshake status %d %s", status, status_message, resp_headers) websocket._exceptions.WebSocketBadStatusException: Handshake status 401 Unauthorized
To my understanding : This is because of digest authentication. 

if i upload a file with curl like in the example here : SWUpdate: API for external programs — Embedded Software Update Documentation 2025.12 documentation and do not use digest I also do not get any results.

a more verbose curl attempt gives us

* upload completely sent off: 5 out of 5 bytes
* Mark bundle as not supporting multiuse
< HTTP/1.1 401 Unauthorized
< WWW-Authenticate: Digest qop="auth", realm="swupdate", nonce="65de1c5b"
< Content-Length: 0

If i do curl --digest -u user:pass -F file=@update_file.swu http://host:8080/upload

It works.

How can I tackle this issue? Any help would be greatly appreciated. 

Kind regards,
Dimitris
 

James Hilliard

unread,
Feb 3, 2026, 12:30:29 PM (11 days ago) Feb 3
to Dimitris Dimopoulos, swupdate
On Tue, Feb 3, 2026 at 6:25 AM Dimitris Dimopoulos <jim....@gmail.com> wrote:
>
> Hello all,
>
> I'm trying to communicate via websocket to swupdate to get a status update of my device being programmed.
>
> swupdate version is 2025.05-
>
> A bit of context:
> In my python application i create a websocket and then I am trying to connect to it.
> So ws.connect(ws://ip:port)
> Before my upload even starts I am getting a 401 error,
>
> File "/usr/local/lib/python3.8/dist-packages/websocket/_handshake.py", line 148, in _get_resp_headers raise WebSocketBadStatusException("Handshake status %d %s", status, status_message, resp_headers) websocket._exceptions.WebSocketBadStatusException: Handshake status 401 Unauthorized
> To my understanding : This is because of digest authentication.

If you run swupdate without authentication does the websocket work?

>
> if i upload a file with curl like in the example here : SWUpdate: API for external programs — Embedded Software Update Documentation 2025.12 documentation and do not use digest I also do not get any results.
>
> a more verbose curl attempt gives us
>
> * upload completely sent off: 5 out of 5 bytes
> * Mark bundle as not supporting multiuse
> < HTTP/1.1 401 Unauthorized
> < WWW-Authenticate: Digest qop="auth", realm="swupdate", nonce="65de1c5b"
> < Content-Length: 0
>
> If i do curl --digest -u user:pass -F file=@update_file.swu http://host:8080/upload
>
> It works.
>
> How can I tackle this issue? Any help would be greatly appreciated.
>
> Kind regards,
> Dimitris
>
>
> --
> You received this message because you are subscribed to the Google Groups "swupdate" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to swupdate+u...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/swupdate/020365d6-c7db-4468-8ce0-c1edc3ade422n%40googlegroups.com.

Dimitris Dimopoulos

unread,
Feb 11, 2026, 2:52:32 AM (4 days ago) Feb 11
to swupdate
Thanks for the reply James, I will check that asap
Reply all
Reply to author
Forward
0 new messages