Bug 445272 - Proxy with authentication and Proxy Auto-Configuration (PAC) files issues
Summary: Proxy with authentication and Proxy Auto-Configuration (PAC) files issues
Status: REPORTED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: HTTP (show other bugs)
Version: 5.245.0
Platform: openSUSE Linux
: NOR major
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-10 11:40 UTC by Rafael Linux User
Modified: 2023-11-21 08:19 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rafael Linux User 2021-11-10 11:40:16 UTC
Our computers are on an intranet that uses a proxy to access the Internet, therefore only for the HTTP(S) protocol. The proxy requires authentication by username and password. To use the other protocols (FTP, FISH, Samba), no proxy is used, since they are only accesses to local servers by their IP.

We use Krusader/Dolphin to remotely access computers using FTP/FISH/Samba.

The first problem we encounter under this scenario is that Plasma must distinguish when a native application requires a proxy and when it does not. To make all this work in Plasma, we have created a Proxy Auto-Configuration (PAC) file. In it we specify that all local addresses, do not use the proxy, and for everything else, it does use it (this is the content of the proxy_PAC_configuration.pac file we have created):

    if (! (url.substring(0, 4)=="http") ) return "DIRECT";
    if (
			isPlainHostName(host)
			|| shExpMatch(host, "*.local")
			|| isInNet(dnsResolve(host), "10.162.0.0.0", "255.255.240.0")
			|| isInNet(dnsResolve(host), "127.0.0.0.0", "255.255.255.255.0")
		)
        return "DIRECT";
    return "PROXY 10.160.0.10:3120; ";

We use this file in the Firefox proxy configuration, to be able to access both Internet HTTP(S) servers and our intranet.

In Plasma's proxy preferences, we specify that this file is also used for any application that needs to access the Internet/Intranet.However, for a few years now, we have had to use for WebKit-based browsers the parameters:
--disable-namespace-sandbox --proxy-pac-url='data:application/x-javascript-config;base64,'$(base64 -w0 /home/myusername/proxy_PAC_configuration.pac)

The native Plasma applications however, seem to ignore that file, because none of them are able to access the Internet using that PAC file. It is inferred that all native Plasma applications, should use the proxy configured through Preferences and, however, it is not so. If I try to download any customizable items that require the Internet, such as:

- "Get new global themes" (under "Globable Themes").
- "Get new Plasma styles" (under "Plasma style").
- "Get new window decorations" (under "Window decorations")
- "Get new graphic elements" (in "Graphic elements" with <Alt><D> and then <A> on the desktop)
-   etc

I must add that issue is present from beginning, since we began to use KDE years ago. 
The proxy configuration at system level is done through Yast (openSUSE tool), and it works perfectly, taking into account that Yast allows to put in the same URL of the proxy, the user and password of access. This allows everything related to the system (updates and downloads) to work smoothly.

I think the problem may be that Plasma never asks for the user/password of the proxy, so it is not possible to access. Browsers do ask for username and password. At the system level (outside the windows environment) the username and password are specified in the proxy configuration form, so the system does not need to ask for them.

Summary: The PAC file is correctly processed by browsers (with the aforementioned for WebKit based browsers). Those other programs that allow to specify a proxy (QMMP, Qbittorrent, Thunderbird). However, KMail is working correctly. Konqueror and Opera (being WebKit based) need specific parameters like Chrome to be able to use the proxy. When launching "Discover", it curiously asks for the "root" password to access the proxy ... 

These problems are why it is very difficult to recommend using Linux desktop environments in enterprises. They require excessive additional configuration, which in "another" operating system is not complex and works.

Operating System: openSUSE Tumbleweed 20211102
KDE Plasma Version: 5.23.2
KDE Frameworks Version: 5.87.0
Qt Version: 5.15.2
Kernel Version: 5.14.14-1-default (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-9700K CPU @ 3.60GHz
Memory: 15.4 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 2060/PCIe/SSE2
Comment 1 Rafael Linux User 2021-11-10 11:49:51 UTC
I forgot a paragraph: Anything involving Internet access from Settings, ends up with a message similar to "Failed to load providers from file https://autoconfig.kde.org/ocs/providers.xml".
Comment 2 Rafael Linux User 2023-11-21 08:19:01 UTC
Additional note: I wrote Discover ask for root password, but it's not for Internet access, but to let it install applications.