@MasterSpecter, I have tested it on Ubuntu 18.04.3 LTS as well, with CLI version 11.21.0 (standalone zip installation) and Firefox versions 69.0 and 72.0.1, and I could not reproduce the error – and as you had pointed out, neither could your coworker. So I think we need to gather some more data from your machine, and figure out where it differs.
Looking at the CLI source code (this file), I gather that the CLI creates a local HTTP server at
http://127.0.0.1 when web authorization is chosen, so that the local web browser can then connect to the CLI to transfer the authentication token. But as far as the CLI is concerned, the server uses the plain HTTP protocol, not HTTPS/SSL/TLS. Inspecting Firefox’s network activity (Firefox menu Web Developer > Inspector), I see however that Firefox adds the
Upgrade-Insecure-Requests header, and then displays a green padlock with the hover tip “The connection used to fetch this resource was secure.” See screenshot:
So I think that’s how the
SSL_ERROR_RX_RECORD_TOO_LONG error could come into play. Google Chrome seems to do the same, but you’ve pointed out that it works OK with Chrome.
I suggest you run the Firefox Inspector as well, open the Network tab and try to repeat the web authorization. It should fail, but perhaps you would find some additional information about the problem. Perhaps you could share your own screenshot of the Network tab.
Some other things to try/consider:
- Run the CLI in debug mode with:
DEBUG=1 balena login
- Try opening https://dashboard.balena-cloud.com/apps on Firefox (the same browser where CLI authentication fails) and Sign Out. Then try the CLI web authorization again (
balena login). Do you use social login with Github or Google? Or do you use a username and password? I’m not sure it matters, but in my own test I was using social login with Github.
- Try deleting the CLI’s
~/.balena cache/config folder:
rm -r ~/.balena.
Note however you might want to make a copy of
~/.balena/secrets.yml file, if you had created one.
- Try bypassing Firefox’s cache as suggested in this thread.
- Try with Firefox 72.0.1 (I couldn’t get hold of Firefox 71.0).
Let us know what you uncover! And thanks for reporting this issue.