Automating proxy configuration across multiple applications without plaintext password
0
votes
1
answer
129
views
More generally than the post described here: https://unix.stackexchange.com/questions/752484/using-bash-functionality-in-rc-files?noredirect=1#comment1432155_752484
I would like to set an appropriate proxy configuration for all/multiple applications including but not limited to: snap/apt/cpan/pip/wget/curl. Moreover, I would like to avoid having my proxy password displayed anywhere in plaintext. How/is it possible to achieve this?
[This post](https://unix.stackexchange.com/questions/279670/how-can-i-specify-a-system-wide-proxy-without-giving-my-password-in-plaintext) implies that every system process will be configured for proxy via
/etc/environment
. I have not had such success (see EDIT), so I am currently under the assumption that all proxy configurations must be made per application. Regarding the [linked post](https://unix.stackexchange.com/questions/266808/avoiding-plain-text-password-in-http-proxy/266934#266934) , and the use of secret-tool
, it seems to me that this assumes the file defining the proxy configuration(s) can evaluate bash expressions (which hasn't been my experience with the .curlrc
/.wgetrc
files).
EDIT:
With the contents of etc/environment
equal to:
http_proxy=http://user:pass@proxy.com:80
https_proxy=http://user:pass@proxy.com:80
and the contents of my .curlrc
file equal to:
proxy=http://user:pass@proxy.com:80
I can run:
curl https://unix.stackexchange.com/posts/752654/edit --output test.html
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 70115 0 70115 0 0 99k 0 --:--:-- --:--:-- --:--:-- 99k
which generates test.html
as expected.
Without changing the contents of /etc/environment
and removing the .curlrc
file, the download hangs indefinitely:
curl https://unix.stackexchange.com/posts/752654/edit --output test.html
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:25 --:--:-- 0
I'm using RHEL on WSL.
Asked by Sterling Butters
(117 rep)
Jul 28, 2023, 02:21 PM
Last activity: Oct 2, 2024, 08:46 PM
Last activity: Oct 2, 2024, 08:46 PM