Passing Proxy creds in Terminal

k3vmo
Contributor II

The env here requires a proxy for outbound traffic.

 

I found an issue that if a user has an @ symbol in their password - it errors that it can't resolve the hostname.

Is there a way I can wrap the password in something to ensure the credentials @ hostname are passed correctly?

If you attempt anything outbound (curl, etc) it gives 'cannot resolve proxy: pass@proxy.host.com

because the pass has an @  only the end of the password is recognized.

proxy error.png

the password, in this case, ends in: @ home

a generic password item is created in the keychain to hold the password.

The setup in the .zshrc file is as such:

 

# CONSTANTS

export PROXY_USER=$USER

export PROXY_PASS=$(security find-generic-password -a $USER -s PROXY_PASSWORD -$

export PROXY_HOST=inetgate.highmark.com

export PROXY_PORT=9119

# TERMINAL VARIABLES

export https_proxy=http://$PROXY_USER:$PROXY_PASS@$PROXY_HOST:$PROXY_PORT

export http_proxy=$https_proxy

# GIT

/usr/bin/git config --global http.proxy $https_proxy

#

/bin/echo "Proxies Enabled"

 

 

0 REPLIES 0