cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: "host not found" with a M$ proxy

From: Roth, Kevin P. <KPRoth_at_MarathonOil.com>
Date: Thu, 28 Jun 2001 11:07:06 -0400

>> I have this proxy-firewall allowing IE but not curl to pass through,
so
>> I'm asking (also myself) which other parameter, apart from the UA
string,
>> could be necessary to set

>If you would show us what headers or responses you get, we might be
able to
>guess. There are MS-proxies that require NTLM, make sure yours doesn't.

I'm trying a couple things against my local Micro$~1 proxy server
(version 2.0) and it is passing back an HTTP status of "400 Bad Request"
if I don't specify at least a "/" after the host-name in my URL.

For example:
  curl -x proxy.host.com:80 http://www.microsoft.com -I -v
gives me:
> HEAD http://www.microsoft.com HTTP/1.1
  User-Agent: curl/7.8 (win32) libcurl 7.8 (OpenSSL 0.9.6)
  Host: www.microsoft.com
  Pragma: no-cache
  Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*

  HTTP/1.1 400 Bad Request
  Server: Microsoft-IIS/4.0
  Date: Thu, 28 Jun 2001 14:53:29 GMT
  Content-Type: text/html
  Content-Length: 87

but if I include at least a trailing slash, as in:
  curl -x proxy.host.com:80 http://www.microsoft.com/ -I -v
I get back:
> HEAD http://www.microsoft.com/ HTTP/1.1
  User-Agent: curl/7.8 (win32) libcurl 7.8 (OpenSSL 0.9.6)
  Host: www.microsoft.com
  Pragma: no-cache
  Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*

  HTTP/1.1 407 Proxy authentication required
  Proxy-Authenticate: NTLM
  Proxy-Authenticate: Basic realm="XX.X.XX.XXX"
  Proxy-Connection: close
  Content-Length: 503
  Content-Type: text/html

So, I don't remember what your initial URL was, but you may have to
adjust slightly in this regard.

Also, notice that I get proxy-authenticate options back in the 2nd
example. If the only one you see is "NTLM", then you won't be able to
use cURL, because it doesn't speak NTLM. You'll have to get your proxy
server administrator to enable Basic authentication... Incidentally, a
netscape (navigator, communicator) browser will also require Basic auth
to be supported in order to get through the MS Proxy server.

--Kevin
Received on 2001-06-28