You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Kris Harry <kr...@gmail.com> on 2005/09/22 11:37:14 UTC

ntlm problem

Hi,
Am trying to post a file through ISA proxy which does ntlm authentication.
Getting responsecode 501, please let me know what went wrong.
Appreciate your help, attached my code and the wire log. thanks in advance.

code
----
Protocol authhttps = new Protocol("https", new
AuthSSLProtocolSocketFactory(), 443);
Protocol.registerProtocol("https", authhttps);
client.getHostConfiguration().setProxy(ProxyHost,ProxyPort);
client.getState().setCredentials(AuthScope.ANY,new
NTCredentials(ProxyUser,ProxyUserPwd,"uat.dcconnect.dc.com<http://uat.dcconnect.dc.com>
",myDomain));
hostconfig.setHost(hostname, 443, authhttps);
client.getHttpConnectionManager().getParams().setConnectionTimeout(300000);


wire log
--------
httpclient.wire.header - >> "CONNECT
uat.dcconnect.dc.com:443<http://uat.dcconnect.dc.com:443>HTTP/1.1"
httpclient.wire.header - >> "User-Agent: Jakarta
Commons-HttpClient/3.0-rc3[\r][\n]"
httpclient.wire.header - >> "Host: uat.dcconnect.dc.com[\r][\n]"
httpclient.wire.header - >> "Proxy-Connection: Keep-Alive[\r][\n]"
httpclient.wire.header - >> "[\r][\n]"
httpclient.wire.header - << "HTTP/1.1 501 Method CONNECT is not defined in
RFC 2068 and is not supported by the Servlet API [\r][\n]"
httpclient.wire.header - << "Content-Type:
text/html;charset=ISO-8859-1[\r][\n]"
httpclient.wire.header - << "Connection: close[\r][\n]"
httpclient.wire.header - << "Content-Language: en-GB[\r][\n]"
httpclient.wire.header - << "Date: Thu, 22 Sep 2005 07:52:53 GMT[\r][\n]"
httpclient.wire.header - << "Server: Apache Tomcat/4.1.24 (HTTP/1.1
Connector)[\r][\n]"
httpclient.wire.content - << "<html><head><title>Apache Tomcat/4.1.24 -
Error report</title><STYLE><!--H1{font-family :
sans-serif,Arial,Tahoma;color : white;background-color : #0086b2;}
H3{font-family : sans-serif,Arial,Tahoma;color : white;background-color :
#0086b2;} BODY{font-family : sans-serif,Arial,Tahoma;color :
black;background-color : white;} B{color : white;background-color :
#0086b2;} HR{color : #0086b2;} --></STYLE> </head><body><h1>HTTP Status 501
- Method CONNECT is not defined in RFC 2068 and is not supported by the
Servlet API </h1><HR size="1" noshade><p><b>type</b> Status
report</p><p><b>message</b> <u>Method CONNECT is not defined in RFC 2068 and
is not supported by the Servlet API </u></p><p><b>description</b> <u>The
server does not support the functionality needed to fulfill this request
(Method CONNECT is not defined in RFC 2068 and is not supported by the
Servlet API ).</u></p><HR size="1" noshade><h3>Apache
Tomcat/4.1.24</h3></body></html>"

Re: ntlm problem

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Fri, Sep 23, 2005 at 07:51:45PM +0800, Kris Harry wrote:
> Thanks Roland, for your help,
> Yes, you are correct.. email editor is adding the <> part. Getting
> what you have expected.
> I have checked the proxy settings, everything (i.e proxy host, proxy
> port and domain) specified is correct. Any idea why am getting the
> following error with ntlm authentication...
> 
> httpclient.wire.header - >> "CONNECT uat.dcconnect.dc.com:443 HTTP/1.1"
> httpclient.wire.header - >> "User-Agent: Jakarta
> Commons-HttpClient/3.0-rc3[\r][\n]"
> httpclient.wire.header - >> "Host: uat.dcconnect.dc.com[\r][\n]"
> httpclient.wire.header - >> "Proxy-Connection: Keep-Alive[\r][\n]"
> httpclient.wire.header - >> "[\r][\n]"
> httpclient.wire.header - << "HTTP/1.1 405 Method Not Allowed[\r][\n]"
> httpclient.wire.header - << "Date: Thu, 23 Sep 2005 05:34:01 GMT[\r][\n]"
> httpclient.wire.header - << "Server: Apache/2.0.46[\r][\n]"
> httpclient.wire.header - << "Allow: GET,HEAD,POST,OPTIONS,TRACE[\r][\n]"

Kris,
The Apache HTTPD server which you are apparently using as a proxy does
not support SSL tunneling or is configured to disallow SSL tunneling

Hope this helps

Oleg



> httpclient.wire.header - << "Content-Length: 235[\r][\n]"
> httpclient.wire.header - << "Content-Type: text/html;
> charset=iso-8859-1[\r][\n]"
> httpclient.wire.content - << "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML
> 2.0//EN">[\n]"
> httpclient.wire.content - << "<html><head>[\n]"
> httpclient.wire.content - << "<title>405 Method Not Allowed</title>[\n]"
> httpclient.wire.content - << "</head><body>[\n]"
> httpclient.wire.content - << "<h1>Method Not Allowed</h1>[\n]"
> httpclient.wire.content - << "<p>The requested method CONNECT is not
> allowed for the URL /index.html.</p>[\n]"
> httpclient.wire.content - << "</body></html>[\n]"
> 
> 
> 
> On 9/22/05, Roland Weber <RO...@de.ibm.com> wrote:
> > Hi Kris,
> >
> > sorry, I don't have the time to dig into your code.
> > This here looks fishy, but I don't know whether
> > this is real output or something that was screwed
> > up by a mail editor:
> >
> > >  httpclient.wire.header - >> "CONNECT
> > > uat.dcconnect.dc.com:443<http://uat.dcconnect.dc.com:443>HTTP/1.1"
> > > httpclient.wire.header - >> "Host: uat.dcconnect.dc.com[\r][\n]"
> >
> > where does the URL part between < > come from?
> > It should read like
> >
> > CONNECT / HTTP/1.1[\r][\n]
> > Host: uat.dcconnect.dc.com[\r][\n]
> >
> > > > Protocol authhttps = new Protocol("https", new
> > > > AuthSSLProtocolSocketFactory(), 443);
> > > > Protocol.registerProtocol("https", authhttps);
> > > > client.getHostConfiguration().setProxy(ProxyHost,ProxyPort);
> > > > client.getState().setCredentials(AuthScope.ANY,new
> > > > NTCredentials(ProxyUser,ProxyUserPwd,"uat.dcconnect.dc.com",myDomain));
> >
> > What's this strange thing in the NTCredentials?
> >
> > > > hostconfig.setHost(hostname, 443, authhttps);
> >
> > make sure 'hostname' is a plain name like uat.dcconnect.dc.com
> > and not http://whatever:443
> >
> > Good luck,
> > Roland
> >
> > > >
> > > > wire log
> > > > --------
> > > > httpclient.wire.header - >> "CONNECT
> > > > uat.dcconnect.dc.com:443 <http://uat.dcconnect.dc.com:443><
> > > > http://uat.dcconnect.dc.com:443>HTTP/1.1"
> > > > httpclient.wire.header - >> "User-Agent: Jakarta
> > > > Commons-HttpClient/3.0-rc3[\r][\n]"
> > > > httpclient.wire.header - >> "Host: uat.dcconnect.dc.com[\r][\n]"
> > > > httpclient.wire.header - >> "Proxy-Connection: Keep-Alive[\r][\n]"
> > > > httpclient.wire.header - >> "[\r][\n]"
> > > > httpclient.wire.header - << "HTTP/1.1 501 Method CONNECT is not
> > defined in
> > > > RFC 2068 and is not supported by the Servlet API [\r][\n]"
> > > > httpclient.wire.header - << "Content-Type:
> > > > text/html;charset=ISO-8859-1[\r][\n]"
> > > > httpclient.wire.header - << "Connection: close[\r][\n]"
> > > > httpclient.wire.header - << "Content-Language: en-GB[\r][\n]"
> > > > httpclient.wire.header - << "Date: Thu, 22 Sep 2005 07:52:53
> > GMT[\r][\n]"
> > > > httpclient.wire.header - << "Server: Apache Tomcat/4.1.24 (HTTP/1.1
> > > > Connector)[\r][\n]"
> > > > httpclient.wire.content - << "<html><head><title>Apache Tomcat/4.1.24
> > -
> > > > Error report</title><STYLE><!--H1{font-family :
> > > sans-serif,
> > > Arial,Tahoma;color : white;background-color : #0086b2;}
> > > H3{font-
> > > family : sans-serif,Arial,Tahoma;color : white;background-color :
> > >
> > > #0086b2;} BODY{font-family : sans-serif,Arial,Tahoma;color :
> > >
> > > black;background-color : white;} B{color : white;background-color :
> >
> > > > #0086b2;} HR{color : #0086b2;} --></STYLE> </head><body><h1>HTTP
> > Status
> > > > 501
> > > > - Method CONNECT is not defined in RFC 2068 and is not supported by
> > the
> > > > Servlet API </h1><HR size="1" noshade><p><b>type</b> Status
> > > > report</p><p><b>message</b> <u>Method CONNECT is not defined in RFC
> > 2068
> > > > and
> > > > is not supported by the Servlet API </u></p><p><b>description</b>
> > <u>The
> > > > server does not support the functionality needed to fulfill this
> > request
> > > > (Method CONNECT is not defined in RFC 2068 and is not supported by the
> > > > Servlet API ).</u></p><HR size="1" noshade><h3>Apache
> > > > Tomcat/4.1.24</h3></body></html>"
> > > >
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail:
> > httpclient-user-help@jakarta.apache.org
> > > >
> > > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Re: ntlm problem

Posted by Kris Harry <kr...@gmail.com>.
Thanks Roland, for your help,
Yes, you are correct.. email editor is adding the <> part. Getting
what you have expected.
I have checked the proxy settings, everything (i.e proxy host, proxy
port and domain) specified is correct. Any idea why am getting the
following error with ntlm authentication...

httpclient.wire.header - >> "CONNECT uat.dcconnect.dc.com:443 HTTP/1.1"
httpclient.wire.header - >> "User-Agent: Jakarta
Commons-HttpClient/3.0-rc3[\r][\n]"
httpclient.wire.header - >> "Host: uat.dcconnect.dc.com[\r][\n]"
httpclient.wire.header - >> "Proxy-Connection: Keep-Alive[\r][\n]"
httpclient.wire.header - >> "[\r][\n]"
httpclient.wire.header - << "HTTP/1.1 405 Method Not Allowed[\r][\n]"
httpclient.wire.header - << "Date: Thu, 23 Sep 2005 05:34:01 GMT[\r][\n]"
httpclient.wire.header - << "Server: Apache/2.0.46[\r][\n]"
httpclient.wire.header - << "Allow: GET,HEAD,POST,OPTIONS,TRACE[\r][\n]"
httpclient.wire.header - << "Content-Length: 235[\r][\n]"
httpclient.wire.header - << "Content-Type: text/html;
charset=iso-8859-1[\r][\n]"
httpclient.wire.content - << "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML
2.0//EN">[\n]"
httpclient.wire.content - << "<html><head>[\n]"
httpclient.wire.content - << "<title>405 Method Not Allowed</title>[\n]"
httpclient.wire.content - << "</head><body>[\n]"
httpclient.wire.content - << "<h1>Method Not Allowed</h1>[\n]"
httpclient.wire.content - << "<p>The requested method CONNECT is not
allowed for the URL /index.html.</p>[\n]"
httpclient.wire.content - << "</body></html>[\n]"



On 9/22/05, Roland Weber <RO...@de.ibm.com> wrote:
> Hi Kris,
>
> sorry, I don't have the time to dig into your code.
> This here looks fishy, but I don't know whether
> this is real output or something that was screwed
> up by a mail editor:
>
> >  httpclient.wire.header - >> "CONNECT
> > uat.dcconnect.dc.com:443<http://uat.dcconnect.dc.com:443>HTTP/1.1"
> > httpclient.wire.header - >> "Host: uat.dcconnect.dc.com[\r][\n]"
>
> where does the URL part between < > come from?
> It should read like
>
> CONNECT / HTTP/1.1[\r][\n]
> Host: uat.dcconnect.dc.com[\r][\n]
>
> > > Protocol authhttps = new Protocol("https", new
> > > AuthSSLProtocolSocketFactory(), 443);
> > > Protocol.registerProtocol("https", authhttps);
> > > client.getHostConfiguration().setProxy(ProxyHost,ProxyPort);
> > > client.getState().setCredentials(AuthScope.ANY,new
> > > NTCredentials(ProxyUser,ProxyUserPwd,"uat.dcconnect.dc.com",myDomain));
>
> What's this strange thing in the NTCredentials?
>
> > > hostconfig.setHost(hostname, 443, authhttps);
>
> make sure 'hostname' is a plain name like uat.dcconnect.dc.com
> and not http://whatever:443
>
> Good luck,
> Roland
>
> > >
> > > wire log
> > > --------
> > > httpclient.wire.header - >> "CONNECT
> > > uat.dcconnect.dc.com:443 <http://uat.dcconnect.dc.com:443><
> > > http://uat.dcconnect.dc.com:443>HTTP/1.1"
> > > httpclient.wire.header - >> "User-Agent: Jakarta
> > > Commons-HttpClient/3.0-rc3[\r][\n]"
> > > httpclient.wire.header - >> "Host: uat.dcconnect.dc.com[\r][\n]"
> > > httpclient.wire.header - >> "Proxy-Connection: Keep-Alive[\r][\n]"
> > > httpclient.wire.header - >> "[\r][\n]"
> > > httpclient.wire.header - << "HTTP/1.1 501 Method CONNECT is not
> defined in
> > > RFC 2068 and is not supported by the Servlet API [\r][\n]"
> > > httpclient.wire.header - << "Content-Type:
> > > text/html;charset=ISO-8859-1[\r][\n]"
> > > httpclient.wire.header - << "Connection: close[\r][\n]"
> > > httpclient.wire.header - << "Content-Language: en-GB[\r][\n]"
> > > httpclient.wire.header - << "Date: Thu, 22 Sep 2005 07:52:53
> GMT[\r][\n]"
> > > httpclient.wire.header - << "Server: Apache Tomcat/4.1.24 (HTTP/1.1
> > > Connector)[\r][\n]"
> > > httpclient.wire.content - << "<html><head><title>Apache Tomcat/4.1.24
> -
> > > Error report</title><STYLE><!--H1{font-family :
> > sans-serif,
> > Arial,Tahoma;color : white;background-color : #0086b2;}
> > H3{font-
> > family : sans-serif,Arial,Tahoma;color : white;background-color :
> >
> > #0086b2;} BODY{font-family : sans-serif,Arial,Tahoma;color :
> >
> > black;background-color : white;} B{color : white;background-color :
>
> > > #0086b2;} HR{color : #0086b2;} --></STYLE> </head><body><h1>HTTP
> Status
> > > 501
> > > - Method CONNECT is not defined in RFC 2068 and is not supported by
> the
> > > Servlet API </h1><HR size="1" noshade><p><b>type</b> Status
> > > report</p><p><b>message</b> <u>Method CONNECT is not defined in RFC
> 2068
> > > and
> > > is not supported by the Servlet API </u></p><p><b>description</b>
> <u>The
> > > server does not support the functionality needed to fulfill this
> request
> > > (Method CONNECT is not defined in RFC 2068 and is not supported by the
> > > Servlet API ).</u></p><HR size="1" noshade><h3>Apache
> > > Tomcat/4.1.24</h3></body></html>"
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> httpclient-user-help@jakarta.apache.org
> > >
> > >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Re: ntlm problem

Posted by Roland Weber <RO...@de.ibm.com>.
Hi Kris,

sorry, I don't have the time to dig into your code.
This here looks fishy, but I don't know whether
this is real output or something that was screwed
up by a mail editor:

>  httpclient.wire.header - >> "CONNECT
> uat.dcconnect.dc.com:443<http://uat.dcconnect.dc.com:443>HTTP/1.1"
> httpclient.wire.header - >> "Host: uat.dcconnect.dc.com[\r][\n]"

where does the URL part between < > come from?
It should read like

CONNECT / HTTP/1.1[\r][\n]
Host: uat.dcconnect.dc.com[\r][\n]

> > Protocol authhttps = new Protocol("https", new
> > AuthSSLProtocolSocketFactory(), 443);
> > Protocol.registerProtocol("https", authhttps);
> > client.getHostConfiguration().setProxy(ProxyHost,ProxyPort);
> > client.getState().setCredentials(AuthScope.ANY,new
> > NTCredentials(ProxyUser,ProxyUserPwd,"uat.dcconnect.dc.com<http:
> //uat.dcconnect.dc.com>
> > <
> > http://uat.dcconnect.dc.com>
> > ",myDomain));

What's this strange thing in the NTCredentials?

> > hostconfig.setHost(hostname, 443, authhttps);

make sure 'hostname' is a plain name like uat.dcconnect.dc.com
and not http://whatever:443

Good luck,
  Roland

> >
> > wire log
> > --------
> > httpclient.wire.header - >> "CONNECT
> > uat.dcconnect.dc.com:443 <http://uat.dcconnect.dc.com:443><
> > http://uat.dcconnect.dc.com:443>HTTP/1.1"
> > httpclient.wire.header - >> "User-Agent: Jakarta
> > Commons-HttpClient/3.0-rc3[\r][\n]"
> > httpclient.wire.header - >> "Host: uat.dcconnect.dc.com[\r][\n]"
> > httpclient.wire.header - >> "Proxy-Connection: Keep-Alive[\r][\n]"
> > httpclient.wire.header - >> "[\r][\n]"
> > httpclient.wire.header - << "HTTP/1.1 501 Method CONNECT is not 
defined in
> > RFC 2068 and is not supported by the Servlet API [\r][\n]"
> > httpclient.wire.header - << "Content-Type:
> > text/html;charset=ISO-8859-1[\r][\n]"
> > httpclient.wire.header - << "Connection: close[\r][\n]"
> > httpclient.wire.header - << "Content-Language: en-GB[\r][\n]"
> > httpclient.wire.header - << "Date: Thu, 22 Sep 2005 07:52:53 
GMT[\r][\n]"
> > httpclient.wire.header - << "Server: Apache Tomcat/4.1.24 (HTTP/1.1
> > Connector)[\r][\n]"
> > httpclient.wire.content - << "<html><head><title>Apache Tomcat/4.1.24 
-
> > Error report</title><STYLE><!--H1{font-family :
> sans-serif,
> Arial,Tahoma;color : white;background-color : #0086b2;}
> H3{font-
> family : sans-serif,Arial,Tahoma;color : white;background-color :
> 
> #0086b2;} BODY{font-family : sans-serif,Arial,Tahoma;color :
> 
> black;background-color : white;} B{color : white;background-color :

> > #0086b2;} HR{color : #0086b2;} --></STYLE> </head><body><h1>HTTP 
Status
> > 501
> > - Method CONNECT is not defined in RFC 2068 and is not supported by 
the
> > Servlet API </h1><HR size="1" noshade><p><b>type</b> Status
> > report</p><p><b>message</b> <u>Method CONNECT is not defined in RFC 
2068
> > and
> > is not supported by the Servlet API </u></p><p><b>description</b> 
<u>The
> > server does not support the functionality needed to fulfill this 
request
> > (Method CONNECT is not defined in RFC 2068 and is not supported by the
> > Servlet API ).</u></p><HR size="1" noshade><h3>Apache
> > Tomcat/4.1.24</h3></body></html>"
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: 
httpclient-user-help@jakarta.apache.org
> >
> >


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Re: ntlm problem

Posted by Kris Harry <kr...@gmail.com>.
Hi Roland,Thanks for your support.
tried with a different different proxy port i.e 80. getting the response
code 405. Is there any problem in the code.?appreciate your help.
 httpclient.wire.header - >> "CONNECT
uat.dcconnect.dc.com:443<http://uat.dcconnect.dc.com:443>HTTP/1.1"
httpclient.wire.header - >> "User-Agent: Jakarta
Commons-HttpClient/3.0-rc3[\r][\n]"
httpclient.wire.header - >> "Host: uat.dcconnect.dc.com[\r][\n]"
httpclient.wire.header - >> "Proxy-Connection: Keep-Alive[\r][\n]"
httpclient.wire.header - >> "[\r][\n]"
httpclient.wire.header - << "HTTP/1.1 405 Method Not Allowed[\r][\n]"
httpclient.wire.header - << "Date: Thu, 22 Sep 2005 06:34:01 GMT[\r][\n]"
httpclient.wire.header - << "Server: Apache/2.0.46[\r][\n]"
httpclient.wire.header - << "Allow: GET,HEAD,POST,OPTIONS,TRACE[\r][\n]"
httpclient.wire.header - << "Content-Length: 235[\r][\n]"
httpclient.wire.header - << "Content-Type: text/html;
charset=iso-8859-1[\r][\n]"
httpclient.wire.content - << "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0
//EN">[\n]"
httpclient.wire.content - << "<html><head>[\n]"
httpclient.wire.content - << "<title>405 Method Not Allowed</title>[\n]"
httpclient.wire.content - << "</head><body>[\n]"
httpclient.wire.content - << "<h1>Method Not Allowed</h1>[\n]"
httpclient.wire.content - << "<p>The requested method CONNECT is not allowed
for the URL /index.html.</p>[\n]"
httpclient.wire.content - << "</body></html>[\n]"


 On 9/22/05, Roland Weber <RO...@de.ibm.com> wrote:
>
> Hi Kris,
>
> please verify your proxy settings. It looks like the proxy
> request is sent to a plain server instead of a proxy.
>
> hope that helps,
> Roland
>
>
>
>
> Kris Harry <kr...@gmail.com>
> 22.09.2005 11:37
> Please respond to
> "HttpClient User Discussion"
>
>
> To
> httpclient-user@jakarta.apache.org
> cc
>
> Subject
> ntlm problem
>
>
>
>
>
>
> Hi,
> Am trying to post a file through ISA proxy which does ntlm authentication.
> Getting responsecode 501, please let me know what went wrong.
> Appreciate your help, attached my code and the wire log. thanks in
> advance.
>
> code
> ----
> Protocol authhttps = new Protocol("https", new
> AuthSSLProtocolSocketFactory(), 443);
> Protocol.registerProtocol("https", authhttps);
> client.getHostConfiguration().setProxy(ProxyHost,ProxyPort);
> client.getState().setCredentials(AuthScope.ANY,new
> NTCredentials(ProxyUser,ProxyUserPwd,"uat.dcconnect.dc.com<http://uat.dcconnect.dc.com>
> <
> http://uat.dcconnect.dc.com>
> ",myDomain));
> hostconfig.setHost(hostname, 443, authhttps);
> client.getHttpConnectionManager
> ().getParams().setConnectionTimeout(300000);
>
>
> wire log
> --------
> httpclient.wire.header - >> "CONNECT
> uat.dcconnect.dc.com:443 <http://uat.dcconnect.dc.com:443><
> http://uat.dcconnect.dc.com:443>HTTP/1.1"
> httpclient.wire.header - >> "User-Agent: Jakarta
> Commons-HttpClient/3.0-rc3[\r][\n]"
> httpclient.wire.header - >> "Host: uat.dcconnect.dc.com[\r][\n]"
> httpclient.wire.header - >> "Proxy-Connection: Keep-Alive[\r][\n]"
> httpclient.wire.header - >> "[\r][\n]"
> httpclient.wire.header - << "HTTP/1.1 501 Method CONNECT is not defined in
> RFC 2068 and is not supported by the Servlet API [\r][\n]"
> httpclient.wire.header - << "Content-Type:
> text/html;charset=ISO-8859-1[\r][\n]"
> httpclient.wire.header - << "Connection: close[\r][\n]"
> httpclient.wire.header - << "Content-Language: en-GB[\r][\n]"
> httpclient.wire.header - << "Date: Thu, 22 Sep 2005 07:52:53 GMT[\r][\n]"
> httpclient.wire.header - << "Server: Apache Tomcat/4.1.24 (HTTP/1.1
> Connector)[\r][\n]"
> httpclient.wire.content - << "<html><head><title>Apache Tomcat/4.1.24 -
> Error report</title><STYLE><!--H1{font-family :
> sans-serif,Arial,Tahoma;color : white;background-color : #0086b2;}
> H3{font-family : sans-serif,Arial,Tahoma;color : white;background-color :
> #0086b2;} BODY{font-family : sans-serif,Arial,Tahoma;color :
> black;background-color : white;} B{color : white;background-color :
> #0086b2;} HR{color : #0086b2;} --></STYLE> </head><body><h1>HTTP Status
> 501
> - Method CONNECT is not defined in RFC 2068 and is not supported by the
> Servlet API </h1><HR size="1" noshade><p><b>type</b> Status
> report</p><p><b>message</b> <u>Method CONNECT is not defined in RFC 2068
> and
> is not supported by the Servlet API </u></p><p><b>description</b> <u>The
> server does not support the functionality needed to fulfill this request
> (Method CONNECT is not defined in RFC 2068 and is not supported by the
> Servlet API ).</u></p><HR size="1" noshade><h3>Apache
> Tomcat/4.1.24</h3></body></html>"
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
>
>

Re: ntlm problem

Posted by Roland Weber <RO...@de.ibm.com>.
Hi Kris,

please verify your proxy settings. It looks like the proxy
request is sent to a plain server instead of a proxy.

hope that helps,
  Roland




Kris Harry <kr...@gmail.com> 
22.09.2005 11:37
Please respond to
"HttpClient User Discussion"


To
httpclient-user@jakarta.apache.org
cc

Subject
ntlm problem






Hi,
Am trying to post a file through ISA proxy which does ntlm authentication.
Getting responsecode 501, please let me know what went wrong.
Appreciate your help, attached my code and the wire log. thanks in 
advance.

code
----
Protocol authhttps = new Protocol("https", new
AuthSSLProtocolSocketFactory(), 443);
Protocol.registerProtocol("https", authhttps);
client.getHostConfiguration().setProxy(ProxyHost,ProxyPort);
client.getState().setCredentials(AuthScope.ANY,new
NTCredentials(ProxyUser,ProxyUserPwd,"uat.dcconnect.dc.com<
http://uat.dcconnect.dc.com>
",myDomain));
hostconfig.setHost(hostname, 443, authhttps);
client.getHttpConnectionManager().getParams().setConnectionTimeout(300000);


wire log
--------
httpclient.wire.header - >> "CONNECT
uat.dcconnect.dc.com:443<http://uat.dcconnect.dc.com:443>HTTP/1.1"
httpclient.wire.header - >> "User-Agent: Jakarta
Commons-HttpClient/3.0-rc3[\r][\n]"
httpclient.wire.header - >> "Host: uat.dcconnect.dc.com[\r][\n]"
httpclient.wire.header - >> "Proxy-Connection: Keep-Alive[\r][\n]"
httpclient.wire.header - >> "[\r][\n]"
httpclient.wire.header - << "HTTP/1.1 501 Method CONNECT is not defined in
RFC 2068 and is not supported by the Servlet API [\r][\n]"
httpclient.wire.header - << "Content-Type:
text/html;charset=ISO-8859-1[\r][\n]"
httpclient.wire.header - << "Connection: close[\r][\n]"
httpclient.wire.header - << "Content-Language: en-GB[\r][\n]"
httpclient.wire.header - << "Date: Thu, 22 Sep 2005 07:52:53 GMT[\r][\n]"
httpclient.wire.header - << "Server: Apache Tomcat/4.1.24 (HTTP/1.1
Connector)[\r][\n]"
httpclient.wire.content - << "<html><head><title>Apache Tomcat/4.1.24 -
Error report</title><STYLE><!--H1{font-family :
sans-serif,Arial,Tahoma;color : white;background-color : #0086b2;}
H3{font-family : sans-serif,Arial,Tahoma;color : white;background-color :
#0086b2;} BODY{font-family : sans-serif,Arial,Tahoma;color :
black;background-color : white;} B{color : white;background-color :
#0086b2;} HR{color : #0086b2;} --></STYLE> </head><body><h1>HTTP Status 
501
- Method CONNECT is not defined in RFC 2068 and is not supported by the
Servlet API </h1><HR size="1" noshade><p><b>type</b> Status
report</p><p><b>message</b> <u>Method CONNECT is not defined in RFC 2068 
and
is not supported by the Servlet API </u></p><p><b>description</b> <u>The
server does not support the functionality needed to fulfill this request
(Method CONNECT is not defined in RFC 2068 and is not supported by the
Servlet API ).</u></p><HR size="1" noshade><h3>Apache
Tomcat/4.1.24</h3></body></html>"



---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org