traccar-manager-android: WebSocket over insecure connection error when using HTTPS
Describe the bug Tracking doesn’t work with an HTTPS end-point server, this message is displayed whenever the app is opened after the first initial login:
Failed to construct ‘WebSocket’: An insecure WebSocket connection may not be initiated from a page loaded over HTTPS.
To Reproduce Steps to reproduce the behavior:
- Set the server URL to an
https://
location - Login
- Restart the app
- See error
Expected behavior No error
Smartphone (please complete the following information):
- Device: ASUS
- OS: Android 11
- Browser: ~Firefox (Fennec)~ Android System WebView
- Version: ~100.1.3~ 96
Additional context This might be a security issue specific to mobiles with Firefox set as the default browser. Somehow the app or website is trying to connect with HTTP even when the page is loaded via HTTPS.
This issue does not happen when the website is directly used from Firefox.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 43 (21 by maintainers)
You can also compile it using the following command:
It will give you an APK file as an output.
Legacy app has a fallback to regular API if WebSocket fails, so the fact that it works doesn’t really prove that you don’t have some WebSocket configuration issue.
You can set this in the config:
And it will default to the debug version.
We have documentation on how to run it locally.