I am behind a corporate firewall, which brings lots of pains in the area of proxies. There are two main approaches I've found to work:
- Use Cntlm at the cost of not being able to connect (from the command line) to HTTPS and external SSH locations. (Cntlm allows you to hash your username and password using PassNTLMv2 (thus avoiding plain text) and set
http://localhost:3128/as your proxy which then redirects to your "real" proxy. As I mentioned, I cannot connect to HTTPS and external SSH using this method.)
- Put my username and password in plain text in the
http_proxyvariable at the cost of having my username and password in plain text.
Clearly, if security was not a concern, I'd just do with option 2.
I found somewhat of a solution, in doing this in my
.babrunrc (I use Babun, it's basically Cygwin with a little extra, the same could be in a
export http_proxy="http://`echo "Y21hbjpwYXNzd29yZA==" | base64 -firstname.lastname@example.org:20/"
This way my password is at least encoded. If someone came to my computer and typed
echo $http_proxy they'd see my password, but I don't think there's any way around this.
Are there any alternative approaches to this? Or maybe a way to encrypt the string as opposed to encoding it? I wouldn't mind typing in some password when I open a prompt if there was no way around it.