cghdev/gotunl

401 Unauthorized Error on login

Closed this issue ยท 4 comments

Hello !
First of all, very nice job for coding what everybody wants ๐Ÿ™๐Ÿป

I just have an issue on the login part that maybe you have encountered before :
{401 Unauthorized 401 HTTP/1.1 1 1 map[Content-Length:[0] Date:[Wed, 12 Aug 2020 10:11:25 GMT]] {} 0 [] false false map[] 0xc00017a000 <nil>}

This error is occurring on the login request within your makeReq() called from ConnectProfile(). At first, I was just not getting any error message, I was just launching the app, writing my credentials, but noting was happening and no connection was established.
So I just added a little print in your code to see what was going on right there :
Screen Shot 2020-08-12 at 12 41 16
And you saw the result ๐Ÿ˜ฌ

Any ideas on what could be the problem here ? ๐Ÿ™๐Ÿป

EDIT: I also saw that you are sending this data as request body :
{ "id": "...", "reconnect": true, "timeout": true, "username":"pritunl", "password":"789715", "data":"..." }
Is that normal that my username is pritunl? Shouldn't it be the one contained in my pritunl .conf file ? ๐Ÿค”

Hi @ibobcode,
What pritunl client version are you using and what operating system?
I assume it works fine when you use Pritunl Client to connect directly from the GUI, right?

Whoah ! Fast answer haha !
Pritunl client : Screen Shot 2020-08-12 at 12 46 16
OS : Screen Shot 2020-08-12 at 12 46 41

And yep, everything works fine when using GUI client โœ…

Could you try to install the latest Pritunl Client version?
Haven't seen that problem before. The only http connections gotunl makes are locally to the pritunl service (in the past to a local port via http, now it does it to a unix socket both for linux and macOS)

Hell yeah it's working ! Thank you for the efficient problem solving !! ๐Ÿ”ฅ