jamesmcm / vopono

Run applications through VPN tunnels with temporary network namespaces
GNU General Public License v3.0
888 stars 46 forks source link

AzireVPN: "Error: error decoding response body" #269

Open rexVictor opened 6 months ago

rexVictor commented 6 months ago

Hi, I tried setting up vopono but get the following error:

$ vopono sync -c Wireguard AzireVPN 2024-05-27T20:06:14.263Z INFO vopono::sync > Starting Wireguard configuration... AzireVPN username: [censored] AzireVPN password: [hidden] Error: error decoding response body

Caused by: missing field data at line 4 column 1

Do I need to run some other command first?

jamesmcm commented 6 months ago

Can you run it with -v to see the debug output?

vopono -v sync -c Wireguard AzireVPN

I assume the response or URL here has changed - https://github.com/jamesmcm/vopono/blob/master/vopono_core/src/config/providers/azirevpn/wireguard.rs#L35

rexVictor commented 6 months ago

Sure thing.

$ vopono -v sync -c Wireguard AzireVPN
 2024-05-28T02:03:58.639Z INFO  vopono::sync > Starting Wireguard configuration...
 2024-05-28T02:03:58.639Z DEBUG vopono_core::util > Using config dir from $HOME config: /home/[censored]/.config
AzireVPN username: [censored]
AzireVPN password: [hidden]
 2024-05-28T02:04:14.727Z DEBUG vopono_core::config::providers::azirevpn::wireguard > Chosen keypair: WgKey { public: "[censored]", private: "[censored]" }
 2024-05-28T02:04:14.729Z DEBUG reqwest::connect                               > starting new connection: https://api.azirevpn.com/
 2024-05-28T02:04:14.827Z DEBUG rustls::client::hs                                  > No cached session for DnsName("api.azirevpn.com")
 2024-05-28T02:04:14.828Z DEBUG rustls::client::hs                                  > Not resuming any session
 2024-05-28T02:04:14.863Z DEBUG rustls::client::hs                                  > Using ciphersuite TLS13_AES_256_GCM_SHA384
 2024-05-28T02:04:14.864Z DEBUG rustls::client::tls13                               > Not resuming
 2024-05-28T02:04:14.865Z DEBUG rustls::client::tls13                               > TLS1.3 encrypted extensions: [ServerNameAck, Protocols([ProtocolName(687474702f312e31)])]
 2024-05-28T02:04:14.865Z DEBUG rustls::client::hs                                  > ALPN protocol is Some(b"http/1.1")
 2024-05-28T02:04:15.118Z DEBUG vopono_core::config::providers::azirevpn::wireguard > Response: Response { url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("api.azirevpn.com")), port: None, path: "/v1/wireguard/connect/ca1", query: None, fragment: None }, status: 200, headers: {"server": "nginx", "content-type": "application/json", "transfer-encoding": "chunked", "connection": "keep-alive", "cache-control": "no-cache", "date": "Tue, 28 May 2024 02:04:15 GMT", "x-ratelimit-limit": "60", "x-ratelimit-remaining": "59", "expires": "Thu, 01 Jan 1970 00:00:01 GMT", "strict-transport-security": "max-age=63072000; includeSubDomains; preload"} }
Error: error decoding response body

Caused by:
    missing field `data` at line 1 column 49

For some weird reason I never saw --verbose in --help despite looking :). I censored the keys. I hope you don't need them. If they are private, it might be a good idea to include a verbose option that doesn't log private data. Is DEBUG reqwest::connect a typo in a string? If you need anything else, I'm glad to provide it. P.S. I didn't quite get from the docs if port forwarding is supported with AzireVPN. It felt a bit contradictory. Maybe you could tell me definitively.

jamesmcm commented 6 months ago

It looks like they've changed the API.

I think port forwarding used to just work with -o xxx when you could get the port assigned on the web, but that might have changed since the original code was written.

LUVROK commented 5 months ago

the same is now for mullvad, idk, but this utility still does not work. But it's a great idea, I hope you fix this error. In general, in order not to depend on the api, the best idea is to use the configs that I have already downloaded, I don't understand why I can't do this, it would be a more universal way to connect