Rafficer / linux-cli-community

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

[BUG]Authentication Failed in ProtonVPN Setup #373

Open ShiningWank0 opened 2 months ago

ShiningWank0 commented 2 months ago

Describe I am encountering an authentication failure when trying to set up ProtonVPN using GitHub Actions. Despite verifying the correctness of the OpenVPN credentials multiple times, the error persists. Here is the complete YAML code for the workflow:

name: ProtonVPN Test

on:
  workflow_dispatch:

jobs:
  proton-vpn-test:
    runs-on: ubuntu-latest

    steps:
      - name: Check out repository
        uses: actions/checkout@v4

      - name: Setup faketty
        uses: Yuri6037/Action-FakeTTY@v1.1

      - name: Disable IPv6
        run: |
          sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
          sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
          sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1

      - name: Set up Proton VPN
        run: mkdir -p binary && wget -P binary https://repo.protonvpn.com/debian/dists/stable/main/binary-all/protonvpn-stable-release_1.0.4_all.deb

      - name: Check repo package
        run: echo "62a9d849835de8a5664cf95329458bf1966780b15cec420bf707b5f7278b9027  binary/protonvpn-stable-release_1.0.4_all.deb" | sha256sum --check -

      - name: Install Proton VPN
        run: |
          sudo dpkg -i binary/protonvpn-stable-release_1.0.4_all.deb
          sudo apt update && sudo apt upgrade

      - name: Install tools
        run: |
          sudo apt install -y openvpn dialog expect python3-pip python3-setuptools xauth x11-apps gnome-terminal xvfb network-manager-gnome
          git clone https://github.com/ProtonVPN/linux-cli-community
          sudo pip3 install -e linux-cli-community
          pip3 install -U pytest-pretty

      - name: Start Xvfb
        run: |
          Xvfb :99 -screen 0 1280x1024x24 &
          export DISPLAY=:99

      - name: Run nm-applet
        run: |
          nohup nm-applet &

      - name: ProtonVPN Login
        env: 
          PROTONVPN_USERNAME: ${{ secrets.PROTONVPN_USERNAME }}
          PROTONVPN_PASSWORD: ${{ secrets.PROTONVPN_PASSWORD }}
        run: |
          faketty bash -c '
          stty cols 120 rows 40
          export COLUMNS=$(tput cols) LINES=$(tput lines)
          expect <<EOF
          set timeout 30
          spawn sudo protonvpn init
          expect "Enter your ProtonVPN OpenVPN username:"
          send "$env(PROTONVPN_USERNAME)\r"
          puts "Pass username"
          expect "Enter your ProtonVPN OpenVPN password:"
          send "$env(PROTONVPN_PASSWORD)\r"
          puts "Pass password"
          expect "Confirm your ProtonVPN OpenVPN password:"
          send "$env(PROTONVPN_PASSWORD)\r"
          puts "Pass confirm"
          expect "Your plan:"
          send "1\r"
          puts "Pass check plan"
          expect "Your choice:"
          send "1\r"
          puts "Pass check choice"
          expect "Is this information correct? \\[Y/n\\]:"
          send "Y\r"
          puts "Pass check information"
          expect eof
          EOF
          '

      - name: Check ProtonVPN
        run: |
          protonvpn --version
          protonvpn status
          protonvpn --help

      - name: Connect to ProtonVPN
        run: sudo protonvpn c --cc JP

      - name: Check the country
        run: |
          IP=$(curl -s http://ifconfig.me)
          echo "IP Address: $IP"
          COUNTRY=$(curl -s https://ipinfo.io/${IP}/country)
          echo "Country Code: $COUNTRY"

      - name: Disconnect ProtonVPN
        run: sudo protonvpn disconnect

Error Message:

[!] Authentication failed.

Additional Information:

Request for Assistance: Could you please help troubleshoot this authentication issue? Any guidance or suggestions would be greatly appreciated.

L-U-T-i commented 6 days ago

Same here.

I've successfully rebuilt the latest Fedora version protonvpn-cli-2.2.12-3.fc41.src.rpm for Rocky Linux 9.4 yesterday.

I am successfully launching custom build proton-vpn-gtk-app-4.7.1 (installed with dependencies python-proton-vpn-local-agent-1.1.4, python3-proton-core-0.3.3, python3-proton-vpn-api-core-0.36.4, python3-proton-vpn-network-manager-0.9.4, all custom build) which offers me a quite long list of free servers for each of the countries:

What I find strange is that # sudo protonvpn c offers me only US (and within of that US-FREE#38 server only), but I get than (for UDP as well as for TCP):

Connecting to US-FREE#38 via UDP...
[!] Authentication failed. 
[!] Please make sure that your Username and Password is correct.

My login credentials are the same as in proton-vpn-gtk-app (which works perfectly well), and it is weird that there is no US-FREE#38 server at the list of servers in proton-vpn-gtk-app at all.

I've rebuilt protonvpn-cli-2.2.12-3 yesterday, because I've been getting an There was an error connecting to the ProtonVPN API error with a previous version protonvpn-cli-2.2.11-9 (rebuilt from protonvpn-cli-2.2.11-9.fc39.src.rpm).

L-U-T-i commented 5 days ago

I've found this comment: https://forum.endeavouros.com/t/issues-with-protonvpn-cli-after-updating-keyring-and-system/42130/3

It turned out that protonvpn-cli actually needs OpenVPN / IKEv2 username and OpenVPN / IKEv2 password (as opposed to your username - which in my case is an email - and your password that you use to login to proton web site or which you enter in GUI / proton-vpn-gtk-app).

You can find both (OpenVPN / IKEv2 username and OpenVPN / IKEv2 password) at your Proton account page: https://account.protonvpn.com/account-password.

What is weird is that just one server (US-FREE#38) is found by protonvpn-cli, and not all servers discovered by GUI. And, that this single server is not on the quite long list of servers, offered by GUI / proton-vpn-gtk-app...

There is also no difference in NetworkManager tray icon when connected through protonvpn-cli (no lock), while the vpn connection established using Proton GUI / proton-vpn-gtk-app is indicated by NetworkManager tray icon, and also listed among NetworkManager connections (right click on NetworkManager tray icon). Don't be confused by this fact, VPN connection is actually established (if reported so by protonvpn-cli) what you can verify checking your public IP (https://www.whatismyip.com/).

ShiningWank0 commented 4 days ago

Same here. The CLI tool doesn’t display the server list properly for me either.