Use libCurl with Bluecoat cookie proxy

I am trying to connect through a Bluecoat proxy that uses cookies during proxy authentication.

I was unable to find a combination of CURLOPT_ settings that will cause CURL to present a cookie during proxy authentication.

So: the proxy responds:

HTTP/1.1 407 Proxy Authentication Required
Proxy-Authenticate: NTLM
Cache-Control: no-cache
Pragma: no-cache
Content-Type: text/html; charset=utf-8
Proxy-Connection: close
Set-Cookie: BCSI-CS-EDD688431754D715=2; Path=/
Connection: close
Content-Length: 825

      

But curl presents no cookie on subsequent authentication attempts, no matter what I set for CURLOPT_COOKIEFILE or CURLOPT_COOKIEJAR.

NOTE. I also use (because I have to)

CURLOPT_PROXYTYPE = CURLPROXY_HTTP
CURLOPT_PROXYAUTH = CURLAUTH_ANY
CURLOPT_HTTPPROXYTUNNEL = 1
CURLOPT_CONNECT_ONLY = 1

      

Can CURL be expected to present a cookie requesting proxy authorization?

Am I using curl_easy_ * going to help with multiple interfaces?

Finally, I am building with 7.19.7

+3


source to share


2 answers


The CONNECT request is done a little bit more separately in code than "normal" requests, and it looks like cookie handling is not being done! I consider this to be a libcurl bug.



(This is my comment above, turned into the correct answer.)

+3


source


You can tunnel through the Blue Coat Proxy. But my advice is not to use a network with a Blue Coat proxy. In a free country, there should be no problem buying a SIM card and using the mobile network.



More details at https://bluecoatproxy.wordpress.com

0


source







All Articles