Fix iOS redirect loop
TMALSS:
Devices on iOS have problems with self-signed certificates & secure WebSocket connection (wss://
). Even if the certificate (in our case turris.local
) is set as a Profile and has granted root access on the device, the https://turris.local/reforis
address is not secure for the system, and iOS will immediately close the secure WebSockets connection with the error message:
WebSocket network error: The operation couldn't be completed. (OSStatus Error -9807.)
which means "Invalid certificate chain".
The normal ws
connection works well, the https
+ wss
with our self-signed certificate turris.local
on iOS doesn't work for me.
There are several almost the same issues on the internet according to self-signed certificates, iOS, and secure WebSockets:
- https://stackoverflow.com/questions/36741972/using-a-self-signed-certificate-with-safari-and-websockets-osx-ios
- https://www.hotelexistence.ca/me/?p=521 (here is a suggestion to use Socket.io)
- https://github.com/kolide/fleet/issues/1241
- https://github.com/jupyterhub/jupyterhub/issues/292
- https://developer.apple.com/forums/thread/120869
As we had a redirect to the login page when WebSockets error occurs (honestly I don't know why maybe in case the user is not logged in/or session is expired), users on iOS devices were stuck in a redirect loop.
Closes: #19 (closed)