Rafficer / linux-cli-community

Linux command-line client for ProtonVPN. Written in Python.
https://protonvpn.com
GNU General Public License v3.0
1.29k stars 195 forks source link

[BUG] Protonvpn-cli 2.2.4 doesn't work with ([!] There was an error connecting to the ProtonVPN API) ERROR #235

Open farzinh opened 4 years ago

farzinh commented 4 years ago

Protonvpn-cli version 2.2.4 doesn't work on Linux with this errors:

[!] There was an error connecting to the ProtonVPN API. [!] Please make sure your connection is working properly!

after searching around I find out error comes from this version 2.2.4, now I just downgrade to 2.1.0 and everything works properly.

I checked out utils.py file in both of versions and It seems like problem comes from API initiation, protonvpn.com is a filtered domain in countries like Iran but in 2.1.0 API comes from protonmail.com and it's working properly.

Desktop (please complete the following information):

ghonchesefidi commented 4 years ago

Check this link: https://github.com/ProtonVPN/linux-cli/issues/97

aliazani commented 4 years ago

@Rafficer I have the same problem please check the solution here it make sense I think: https://github.com/ProtonVPN/linux-cli/pull/237

Rafficer commented 4 years ago

No need for a proxy, you can change the api domain in the config file.

aliazani commented 4 years ago

@Rafficer I changed api_domain to https://api.protonmail.ch/ but still have the same problem

Rafficer commented 4 years ago

It's just supposed to be api.protonmail.ch iirc.

aliazani commented 4 years ago

@Rafficer Thanks I changed it and now it works properly :)

iiriix commented 4 years ago

No need for a proxy, you can change the api domain in the config file.

@Rafficer This can be easily blocked again. Isn't it better to add proxy support for the users who need it?

Rafficer commented 4 years ago

Brings the issue of "do you trust the proxy". The better solution is to implement alternative routing, which is being worked on.

iiriix commented 4 years ago

This can be an optional feature for those who "trust their proxy", and of course, it will be disabled by default. :-/

molaeiali commented 4 years ago

@Rafficer "Proxy" is not necessarily a server which we have no control on, It can be Tor, or a ssh tunnel to our own server, etc. Clearly, the proxy is just an option that can be used by users who live in countries with blocked ProtonVPN domains.

Rafficer commented 4 years ago

Definitely, but it also gives users that don't know any better the possibility to reveal information they shouldn't reveal.

iiriix commented 4 years ago

With all due respect, it doesn't make sense. It's similar to "Custom DNS", "Kill Switch", or even "Split Tunneling". If you don't know what you're doing, all of them can reveal information you shouldn't reveal. :)

jdbancal commented 3 years ago

Same problem here, but from France(!). Also, ping api.protonvpn.ch is successful. Nevertheless, the command sudo protonvpn init returns

[!] There was an error connecting to the ProtonVPN API.
[!] Please make sure your connection is working properly!

After changing the api server to api.protonmail.ch in /usr/local/lib/python3.8/dist-packages/protonvpn_cli/utils.py, sudo protonvpn init is successful. However, I still cannot connect, the command sudo protonvpn c ends with the following message:

Connecting to CH#18-TOR via TCP...
[!] Authentication failed. 
[!] Please make sure that your Username and Password is correct.

Using here the password with which I can log onto http://www.protonvpn.com. Hence, I still cannot connect from my PC.

jdbancal commented 3 years ago

All the docs out there may not be consistent at the moment... Maybe this could be linked with using the protonvpn login credentials, instead of the openvpn ones (accessible through the settings menu on the protonvpn website)

farzinh commented 3 years ago

I'm using version 2.1.0, and it's working like a charm.

JRDetwiler commented 3 years ago

OP's original post helped me; I'm on Manjaro currently. I was experiencing the

[!] There was an error connecting to the ProtonVPN API.
[!] Please make sure your connection is working properly!

message from my new house where I had new service (pretty crappy) and a new router. If I ran the status command after connecting, I would find that my previous connection had resumed. However, everything was working whenever I would connect elsewhere, like on campus at my university, making me think it had to be one of those two causing the problem.

I just ran sudo protonvpn init again and that fixed it. Hopefully it'll stay fixed.

kopach commented 2 years ago

hi there. any updates on this? I'm facing the same issue

JRDetwiler commented 2 years ago

hi there. any updates on this? I'm facing the same issue

There's a new app altogether now. https://protonvpn.com/blog/protonvpn-linux-app/

kopach commented 2 years ago

There's a new app altogether now. protonvpn.com/blog/protonvpn-linux-app

It seems to not support CLI mode and requires GUI (which I do not have on my machine)

JRDetwiler commented 2 years ago

There's a new app altogether now. protonvpn.com/blog/protonvpn-linux-app

It seems to not support CLI mode and requires GUI (which I do not have on my machine)

You're looking for this then. https://protonvpn.com/support/linux-vpn-tool/

em20nn commented 2 years ago

I don't know what caused my error but I could overcome with this line; sudo protonvpn c -f (for fastest) -p tcp (or udp) I dont know what the issue is and how to fix, but this line made me connect to the fastest server using tcp protocol.

Alireza17224 commented 1 year ago

Same issue

jh-devv commented 10 months ago

Same issue on NIX OS with the CLI and GUI

PAVAN1698 commented 6 months ago

I am getting the below error while using Proton VPN CLI. Is this information correct? [Y/n]: Y Writing configuration to disk... [!] There was an error with accessing the ProtonVPN API. [!] Please make sure your connection is working properly! [!] HTTP Error Code: 422

prasanshivarapu commented 2 weeks ago

I am getting the below error while using Proton VPN CLI. Is this information correct? [Y/n]: Y Writing configuration to disk... [!] There was an error with accessing the ProtonVPN API. [!] Please make sure your connection is working properly! [!] HTTP Error Code: 422

same im also getting, did u find any solution