Hi,
I have deployed a JupyterLab instance with a nginx with SSL enabled using a self-signed certificate. It’s working on Firefox and Chrome over HTTPS, but on Safari 12.1.2 (MacOs), the web console indicates that is not possible to establish the WebSocket (WSS) connection:
WebSocket connection to 'wss://……' failed: Unexpected response code: 401
Does someone have a workaround for this issue?
Best Regards,
Eduardo
hessu commented
Hi, it appears that some browsers do not pass over the authentication information from plain HTTP requests session to the WebSocket requests. The 401 response is coming from nginx, not hass.
To support those browsers with WebSocket API, the auth_pam directives would need to be excluded for /api/websocket URL as described in #5954, comment by #5954 (comment) – the example of adding a separate "location /api/websocket" block without auth_* directives works, although the description around it does not describe why it's needed.
For nginx, have you tried creating a seperate location for the
/api/websocket? See http://nginx.org/en/docs/http/websocket.html for more info.For example:
# add this to your server {} location /api/websocket { proxy_pass http://[change-me-to-hass-location]/api/websocket; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; }Haven't tested this yet because I don't use a reverse proxy, but could be a logical explanation.
Strangely enough the web app on iOS (bookmark added to the home screen, webview launches in separate process) continues to work, however I cannot establish a connection using Safari or, (a freshly installed) Chrome instance on the same device.
The chances are that your "pinned" webapp in iOS is still an old version of the web ui, using the EventStream instead of websocket.
--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/BDBA5F39-96A6-47E5-9DDC-7E6ABEC7434A%40qualtera.com.
Hi Afshin,
Thank you for your reply. I have tried the proposed solution and other combinations. Unfortunately, it doesn’t work.
Regards,
Eduardo
To view this discussion on the web visit
https://groups.google.com/d/msgid/jupyter/CAJ%2BUHtcgON7j-y29qXe5wCzL3K%3Da2dn3yzkcTqagz1Z%2Bawx8_Q%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/03833530-F834-4EB0-A62A-ED13FF26BF0B%40qualtera.com.
Hi Darian,
I have used the correct location: /api/kernels. The issue is related to Safari, it opens and closes the connection.
To view this discussion on the web visit
https://groups.google.com/d/msgid/jupyter/CAJ%2BUHtdAvN%3D1Fwbo-rgy59aRca6tM2MPm4ZCghmFLWB1uv%2BXRg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/522DDC0E-D946-49C4-B02A-651CA2071659%40qualtera.com.