Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

HTTP proxy with authentication is broken #218

Closed
stdevPavelmc opened this issue Nov 27, 2020 · 12 comments
Closed

HTTP proxy with authentication is broken #218

stdevPavelmc opened this issue Nov 27, 2020 · 12 comments
Labels
bug Something isn't working info required This doesn't seem right or more details are required

Comments

@stdevPavelmc
Copy link

stdevPavelmc commented Nov 27, 2020

Describe the bug

I'm behind a HTTP proxy server (squid) with authentication (basic) and cawbird does not work, on the log it showing "Proxy Authentication Required"

To Reproduce
Steps to reproduce the behavior:

Scenario 1:

  1. Go to Gnome control panel and set manual proxy (no auth possibility there)
  2. Start Cawbird on console, no connection.
  3. See attached file console_log_proxy_via_gnome_panel.txt
  4. See error

Scenario 2:

  1. Set proxy wirt user & password on console, test with a fetch to google, all works
  2. Start Cawbirs on console, no connection.
  3. See attached file console_log_proxy+auth_via_console.txt
  4. See error

Expected behavior

Scenario 1:

Cawbird detects the proxy, detects it needs an auth credentials and ask for it.

Scenario 2:

Cawbird detects the proxy and the auth credentials in the environment and use them.

System details:

  • Ubuntu 20.04 LTS latest updates of today
  • Laptop, 64bit OS, Gnome Vanilla (shell)
  • Cawbird 1.2.1-1+7.1 installed from the .deb file in the Suse build servers
  • Connection via a proxy server (Squid 4.x) with authentication (Basic schema)

Additional context
Add any other context about the problem here.

Running G_MESSAGES_DEBUG=cawbird cawbird can give useful debug output.

See file debug.txt

@IBBoard
Copy link
Owner

IBBoard commented Nov 27, 2020

Huh. I assumed librest (being a core Gnome library) would handle this transparently for us.

I doubt we can support Scenario 1 because there's no obvious way to prompt for credentials (and there's so many edge cases for needing re-authentication in the middle of various different requests). What does wget do when you don't specify the credentials? And why can you not supply the host name with the proxy in Gnome control panel?

We should try to get Scenario 2 working, though.

[Edit] Quick question - is your username just a username, or does it have non-alphanumeric characters? (e.g. [email protected] when working for Example Inc)

[Edit2] And Gnome definitely appears to support authentication on proxies (which I'd expect, or else it wouldn't work in various business environments) - https://unix.stackexchange.com/a/38967/23581

@IBBoard IBBoard added bug Something isn't working info required This doesn't seem right or more details are required labels Nov 27, 2020
@IBBoard
Copy link
Owner

IBBoard commented Nov 28, 2020

Also, based on this old Corebird bug can you run G_MESSAGES_DEBUG=all cawbird and see whether it prints anything about proxies at the start.

@stdevPavelmc
Copy link
Author

What does wget do when you don't specify the credentials?

here it's

user@laptop:~$ wget http://www.google.com
--2020-11-28 13:06:20--  http://www.google.com/
Resolviendo www.google.com (www.google.com)... falló: Fallo temporal en la resolución del nombre.
wget: no se pudo resolver la dirección del equipo “www.google.com”
user@laptop:~$ 

@stdevPavelmc
Copy link
Author

stdevPavelmc commented Nov 28, 2020

[Edit] Quick question - is your username just a username, or does it have non-alphanumeric characters? (e.g. [email protected] when working for Example Inc)

The username is simple, like user but the password has a special character !, encoded like %21

@stdevPavelmc
Copy link
Author

[Edit2] And Gnome definitely appears to support authentication on proxies (which I'd expect, or else it wouldn't work in various business environments) - https://unix.stackexchange.com/a/38967/23581

Yes, the auth can be set in gnome control panel, embedded in the hostname of the proxy, the result is the scenario 2...

@stdevPavelmc
Copy link
Author

Also, based on this old Corebird bug can you run G_MESSAGES_DEBUG=all cawbird and see whether it prints anything about proxies at the start.

It prints nothing about proxys at the start (before the typical output)

@stdevPavelmc
Copy link
Author

I have created an test env:

Local squid a proxy in a private network without internet access, and the proxy is set in the environment (does not mind the if via shell env or Gnome panel) BUT without authentication...

And it works, I will implement the authentication schema (basic) during the day to test it.

@IBBoard
Copy link
Owner

IBBoard commented Nov 28, 2020

Okay, thanks. Good to know that we transparently handle unauthenticated proxies that are set by the system 🙂

@IBBoard
Copy link
Owner

IBBoard commented Dec 12, 2020

Any luck with the authenticated proxy?

@stdevPavelmc
Copy link
Author

Any luck with the authenticated proxy?

Not tried again, sorry.

Busy here closing the year at work, the next week will be free and will try & feedback

@IBBoard
Copy link
Owner

IBBoard commented Dec 17, 2020

No problem. Completely understand.

@IBBoard
Copy link
Owner

IBBoard commented Feb 6, 2021

I think that proxies are outside our control and the various libraries that we use should just silently do the right thing for us, but I don't have a system to test on. I'll close this unless there's anything that we're clearly doing wrong.

@IBBoard IBBoard closed this as completed Feb 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working info required This doesn't seem right or more details are required
Projects
None yet
Development

No branches or pull requests

2 participants