I have configured a Squid Proxy and it seems to be working when I add below Env variables to the /home/user/.bashrc file to a client machine. Note: SSL Bump is configured, Self Signed Cert is added to the /etc/ssl/certs and the cert is being trusted.
export http_proxy=http://220.127.116.11:3128/ export https_proxy=http://18.104.22.168:3128/
For example when I run
user@squid-client:$ echo $http_proxy http://22.214.171.124:3128/ user@squid-client:/tmp$ wget https://google.com --2021-08-17 09:42:14-- https://google.com/ Connecting to 126.96.36.199:3128... connected. Proxy request sent, awaiting response... 301 Moved Permanently Location: https://www.google.com/ [following] --2021-08-17 09:42:14-- https://www.google.com/ Connecting to 188.8.131.52:3128... connected. Proxy request sent, awaiting response... 200 OK Length: unspecified [text/html] Saving to: ‘index.html.1’ index.html.1 [ <=> ] 12.68K --.-KB/s in 0s 2021-08-17 09:42:15 (42.6 MB/s) - ‘index.html.1’ saved 
Now I connected this Linux instance to my Jenkins Master as a slave (Unix Slave via SSH) and run a simple pipeline script which basically has the same wget command.
But the squid access log nor the Jenkins Console output does not show anything related to the Squid Proxy.
Here is the part of the console output from that Jenkins Job.
+ wget google.com --2021-08-17 09:26:39-- http://google.com/ Resolving google.com (google.com)... 184.108.40.206, 2607:f8b0:4023:1002::64, 2607:f8b0:4023:1002::8a, ... Connecting to google.com (google.com)|220.127.116.11|:80... connected. HTTP request sent, awaiting response... 301 Moved Permanently Location: http://www.google.com/ [following] --2021-08-17 09:26:39-- http://www.google.com/ Resolving www.google.com (www.google.com)... 18.104.22.168, 2607:f8b0:4023:1006::6a, 2607:f8b0:4023:1006::93, ... Connecting to www.google.com (www.google.com)|22.214.171.124|:80... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [text/html] Saving to: ‘index.html.4’
I executed the "printenv" command via the pipeline and it also does not show $http_proxy variable.
I want my jobs to download packages, files via this Squid Proxy Server. Any help would be really appreciated.
Note 2: I tried to source /etc/profile (after adding the export http_proxy lines to that file) and seems source is not supported in whatever the shell used by the Jenkins slave service.
Note 3: Both The Squid Proxy and the Client (Jenkins Slave )runs on Ubuntu 18.04.