I know it is pretty straightforward to use/export http_proxy and https_proxy in any Linux variant but, when it becomes tricky if we want to use with authentication like below,
I have test this it is works fine with curl directly without http_proxy or https_proxy on,
unset http_proxy; curl -x http://proxy-abc-xyz.com:8080 --proxy-user [email protected] -L http://www.yahoo.com
Above command asks for the password :
I enter it on the screen, the page loads up, which is completely fine.
My Password is something like this :
A@CDe2022@@@
But when I try with simple export command, I couldn't able to make it work,
export http_proxy="http://[email protected]:A@CDe2022@@@@proxy-abc-xyz.com:8080"
export https_proxy="http://[email protected]:A@CDe2022@@@@proxy-abc-xyz.com:8080"
Three @@@'s are in password the next one is for the domain.
But the above is not working somehow.
When I try with curl -v https://www.google.com
the command just stalls there no output at all, it tries to connect but it is not able to get through.
Could someone help with this?
Thank you!
curl -x http://proxy-abc-xyz.com:8080 --proxy-user [email protected]:<password> -L http://www.yahoo.com
I get the below output using curl when I export the proxy with http_proxy, https_proxy, HTTP_PROXY, HTTPS_PROXY, NO_PROXY, and no_proxy.curl -v www.google.com * About to connect() to proxy abc-xyz.com port 0 (#0) * Trying <ip-address>...
It stalls here. Tried both ways like encoding the URL & password way[email protected]
will look likeiam%40abc-xyz.com
,A@CDe2022@@@
is encoded asA%40CDe2022%40%40%40
, and the whole thing needs to look likehttp://iam%40abc-xyz.com:A%40CDe2022%40%40%[email protected]:8080
. Notice there is only a single '@' character here, and it is after the password. There is no '@' in username or in password - it is urlencoded.* Proxy auth using Basic with user '[email protected]:A@CDe2022@@@' > CONNECT www.google.com:443 HTTP/1.1 > Host: www.google.com:443 > Proxy-Authorization: Basic cmFtY > User-Agent: curl/7.29.0 > Proxy-Connection: Keep-Alive > < HTTP/1.1 407 Proxy **Authentication Required** < Proxy-Authenticate: NEGOTIATE < Proxy-Authenticate: NTLM < Proxy-Authenticate: BASIC realm="ntlm"