3

This fails:

$ curl --trace multipart-fail.log -F "source={}" http://127.0.0.1:3003/jslint

With a squid status 417 error, ERR_INVALID_REQ.

I've never had this in practice through a web browser, so it's probably curl usage instead of squid, but if I tell curl not to use the squid proxy, the web application on the other end accepts it just fine.

(If there's a more appropriate StackExchange site for this, please let me know.)

1
  • Should probably go on ServerFault.
    – Josh K
    Jan 29, 2010 at 20:43

4 Answers 4

4

Squid doesn't support Expect: 100-continue, being a HTTP/1.0 device. Notice the response status code 417 Expectation failed.

Curl should retry the request automatically, but it doesn't; instead, you need to suppress the Expect header; e.g.,

curl -H "Expect:" --trace multipart-fail.log -F "source={}" http://127.0.0.1:3003/jslint
3

Alternatively you can configure Squid to simply ignore that request header...

Add in squid.conf: ignore_expect_100 on

http://www.squid-cache.org/Doc/config/ignore_expect_100/

1

For anyone who stumbles across this question and is getting the same problem with cURL in PHP (not the command line), try adding this line:

curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));

It worked for me.

0

After a long time I fixed this issue in the following manner..

//proxy server address
        $proxyServer="192.168.43.201";
//Proxy server port
        $proxyPort="3128";

     curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_NTLM);
     curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
     curl_setopt($ch, CURLOPT_PROXY, "$proxyServer:$proxyPort");

Reff: http://djzone.im/2010/05/php-curl-ntlm-squid-proxy-authentication/

Hope this helps someone...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .