hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cech. Ulrich" <Ulrich.C...@aeb.de>
Subject AW: NTLM-Proxy authentication and SSL-target
Date Wed, 29 Oct 2008 08:17:57 GMT
Hi Oleg,

Thanks for your reply.
Correct, I use the NTLM-support like it is described in the documentation
(with jcifs etc.). And that worked fine for no-SSL-targets.

Thanks for your help,
Ulrich


Ok, here is the information you requested:
executing request: GET / HTTP/1.1
via proxy: http://s-hqw2k3bd:3128
to target: https://www.verisign.com:443
[DEBUG] ClientParamsStack - 'http.protocol.max-redirects': null
[DEBUG] ClientParamsStack - 'http.route.forced-route': null
[DEBUG] ClientParamsStack - 'http.route.local-address': null
[DEBUG] ClientParamsStack - 'http.route.default-proxy':
http://s-hqw2k3bd:3128
[DEBUG] ClientParamsStack - 'http.conn-manager.timeout': null
[DEBUG] SingleClientConnManager - Get connection for route
HttpRoute[{tls}->http://s-hqw2k3bd:3128->https://www.verisign.com:443]
[DEBUG] ClientParamsStack - 'http.connection.stalecheck': null
[DEBUG] DefaultRequestDirector - Stale connection check
[DEBUG] DefaultRequestDirector - Stale connection detected
[DEBUG] DefaultClientConnection - Connection closed
[DEBUG] ClientParamsStack - 'http.connection.timeout': null
[DEBUG] ClientParamsStack - 'http.tcp.nodelay': null
[DEBUG] ClientParamsStack - 'http.socket.timeout': null
[DEBUG] ClientParamsStack - 'http.socket.linger': null
[DEBUG] ClientParamsStack - 'http.socket.buffer-size': null
[DEBUG] ClientParamsStack - 'http.protocol.element-charset': null
[DEBUG] ClientParamsStack - 'http.connection.max-line-length': null
[DEBUG] ClientParamsStack - 'http.protocol.element-charset': null
[DEBUG] ClientParamsStack - 'http.connection.max-header-count': null
[DEBUG] ClientParamsStack - 'http.connection.max-line-length': null
[DEBUG] ClientParamsStack - 'http.connection.max-status-line-garbage': null
[DEBUG] ClientParamsStack - 'http.protocol.version': HTTP/1.1
[DEBUG] ClientParamsStack - 'http.useragent': Apache-HttpClient/4.0-beta1
(java 1.4)
[DEBUG] wire - >> "CONNECT www.verisign.com:443 HTTP/1.1[EOL]"
[DEBUG] wire - >> "User-Agent: Apache-HttpClient/4.0-beta1 (java 1.4)[EOL]"
[DEBUG] wire - >> "[EOL]"
[DEBUG] headers - >> CONNECT www.verisign.com:443 HTTP/1.1
[DEBUG] headers - >> User-Agent: Apache-HttpClient/4.0-beta1 (java 1.4)
[DEBUG] wire - << "HTTP/1.0 407 Proxy Authentication Required[EOL]"
[DEBUG] wire - << "Server: squid/2.6.STABLE6-NT[EOL]"
[DEBUG] wire - << "Date: Wed, 29 Oct 2008 07:36:24 GMT[EOL]"
[DEBUG] wire - << "Content-Type: text/html[EOL]"
[DEBUG] wire - << "Content-Length: 1347[EOL]"
[DEBUG] wire - << "Expires: Wed, 29 Oct 2008 07:36:24 GMT[EOL]"
[DEBUG] wire - << "X-Squid-Error: ERR_CACHE_ACCESS_DENIED 0[EOL]"
[DEBUG] wire - << "Proxy-Authenticate: NTLM[EOL]"
[DEBUG] wire - << "X-Cache: MISS from s-hqw2k3bd.pmbelz.de[EOL]"
[DEBUG] wire - << "X-Cache-Lookup: NONE from s-hqw2k3bd.pmbelz.de:3128[EOL]"
[DEBUG] wire - << "Via: 1.0 s-hqw2k3bd.pmbelz.de:3128
(squid/2.6.STABLE6-NT)[EOL]"
[DEBUG] wire - << "Proxy-Connection: close[EOL]"
[DEBUG] headers - << HTTP/1.0 407 Proxy Authentication Required
[DEBUG] headers - << Server: squid/2.6.STABLE6-NT
[DEBUG] headers - << Date: Wed, 29 Oct 2008 07:36:24 GMT
[DEBUG] headers - << Content-Type: text/html
[DEBUG] headers - << Content-Length: 1347
[DEBUG] headers - << Expires: Wed, 29 Oct 2008 07:36:24 GMT
[DEBUG] headers - << X-Squid-Error: ERR_CACHE_ACCESS_DENIED 0
[DEBUG] headers - << Proxy-Authenticate: NTLM
[DEBUG] headers - << X-Cache: MISS from s-hqw2k3bd.pmbelz.de
[DEBUG] headers - << X-Cache-Lookup: NONE from s-hqw2k3bd.pmbelz.de:3128
[DEBUG] headers - << Via: 1.0 s-hqw2k3bd.pmbelz.de:3128
(squid/2.6.STABLE6-NT)
[DEBUG] headers - << Proxy-Connection: close
[INFO] ResponseProcessCookies - CookieSpec not available in HTTP context
[DEBUG] ClientParamsStack - 'http.protocol.handle-authentication': null
[DEBUG] DefaultRequestDirector - Proxy requested authentication
[DEBUG] DefaultProxyAuthenticationHandler - Authentication schemes in the
order of preference: [ntlm, digest, basic]
[DEBUG] DefaultProxyAuthenticationHandler - ntlm authentication scheme
selected
[DEBUG] DefaultRequestDirector - Authorization challenge processed
[DEBUG] DefaultRequestDirector - Authentication scope: NTLM <any
realm>@s-hqw2k3bd:3128
[DEBUG] DefaultRequestDirector - Found credentials
[DEBUG] DefaultClientConnection - Connection closed
[DEBUG] ClientParamsStack - 'http.connection.timeout': null
[DEBUG] ClientParamsStack - 'http.tcp.nodelay': null
[DEBUG] ClientParamsStack - 'http.socket.timeout': null
[DEBUG] ClientParamsStack - 'http.socket.linger': null
[DEBUG] ClientParamsStack - 'http.socket.buffer-size': null
[DEBUG] ClientParamsStack - 'http.protocol.element-charset': null
[DEBUG] ClientParamsStack - 'http.connection.max-line-length': null
[DEBUG] ClientParamsStack - 'http.protocol.element-charset': null
[DEBUG] ClientParamsStack - 'http.connection.max-header-count': null
[DEBUG] ClientParamsStack - 'http.connection.max-line-length': null
[DEBUG] ClientParamsStack - 'http.connection.max-status-line-garbage': null
[DEBUG] ClientParamsStack - 'http.protocol.version': HTTP/1.1
[DEBUG] ClientParamsStack - 'http.useragent': Apache-HttpClient/4.0-beta1
(java 1.4)
[DEBUG] wire - >> "CONNECT www.verisign.com:443 HTTP/1.1[EOL]"
[DEBUG] wire - >> "User-Agent: Apache-HttpClient/4.0-beta1 (java 1.4)[EOL]"
[DEBUG] wire - >> "Proxy-Authorization: NTLM
TlRMTVNTUAABAAAAATIAAAYABgAgAAAABwAHACYAAABQTUJFTFpQQy0xNjM0[EOL]"
[DEBUG] wire - >> "[EOL]"
[DEBUG] headers - >> CONNECT www.verisign.com:443 HTTP/1.1
[DEBUG] headers - >> User-Agent: Apache-HttpClient/4.0-beta1 (java 1.4)
[DEBUG] headers - >> Proxy-Authorization: NTLM
TlRMTVNTUAABAAAAATIAAAYABgAgAAAABwAHACYAAABQTUJFTFpQQy0xNjM0
[DEBUG] wire - << "HTTP/1.0 407 Proxy Authentication Required[EOL]"
[DEBUG] wire - << "Server: squid/2.6.STABLE6-NT[EOL]"
[DEBUG] wire - << "Date: Wed, 29 Oct 2008 07:36:24 GMT[EOL]"
[DEBUG] wire - << "Content-Type: text/html[EOL]"
[DEBUG] wire - << "Content-Length: 1347[EOL]"
[DEBUG] wire - << "Expires: Wed, 29 Oct 2008 07:36:24 GMT[EOL]"
[DEBUG] wire - << "X-Squid-Error: ERR_CACHE_ACCESS_DENIED 0[EOL]"
[DEBUG] wire - << "Proxy-Authenticate: NTLM
TlRMTVNTUAACAAAAAAAAADgAAAABAgACJxWYyBecHP8AAAAAAAAAAAAAAAA4AAAABQLODgAAAA8=
[EOL]"
[DEBUG] wire - << "X-Cache: MISS from s-hqw2k3bd.pmbelz.de[EOL]"
[DEBUG] wire - << "X-Cache-Lookup: NONE from s-hqw2k3bd.pmbelz.de:3128[EOL]"
[DEBUG] wire - << "Via: 1.0 s-hqw2k3bd.pmbelz.de:3128
(squid/2.6.STABLE6-NT)[EOL]"
[DEBUG] wire - << "Proxy-Connection: close[EOL]"
[DEBUG] headers - << HTTP/1.0 407 Proxy Authentication Required
[DEBUG] headers - << Server: squid/2.6.STABLE6-NT
[DEBUG] headers - << Date: Wed, 29 Oct 2008 07:36:24 GMT
[DEBUG] headers - << Content-Type: text/html
[DEBUG] headers - << Content-Length: 1347
[DEBUG] headers - << Expires: Wed, 29 Oct 2008 07:36:24 GMT
[DEBUG] headers - << X-Squid-Error: ERR_CACHE_ACCESS_DENIED 0
[DEBUG] headers - << Proxy-Authenticate: NTLM
TlRMTVNTUAACAAAAAAAAADgAAAABAgACJxWYyBecHP8AAAAAAAAAAAAAAAA4AAAABQLODgAAAA8=
[DEBUG] headers - << X-Cache: MISS from s-hqw2k3bd.pmbelz.de
[DEBUG] headers - << X-Cache-Lookup: NONE from s-hqw2k3bd.pmbelz.de:3128
[DEBUG] headers - << Via: 1.0 s-hqw2k3bd.pmbelz.de:3128
(squid/2.6.STABLE6-NT)
[DEBUG] headers - << Proxy-Connection: close
[INFO] ResponseProcessCookies - CookieSpec not available in HTTP context
[DEBUG] ClientParamsStack - 'http.protocol.handle-authentication': null
[DEBUG] DefaultRequestDirector - Proxy requested authentication
[DEBUG] DefaultRequestDirector - Authorization challenge processed
[DEBUG] DefaultRequestDirector - Authentication scope: NTLM <any
realm>@s-hqw2k3bd:3128
[DEBUG] DefaultClientConnection - Connection closed
[DEBUG] ClientParamsStack - 'http.connection.timeout': null
[DEBUG] ClientParamsStack - 'http.tcp.nodelay': null
[DEBUG] ClientParamsStack - 'http.socket.timeout': null
[DEBUG] ClientParamsStack - 'http.socket.linger': null
[DEBUG] ClientParamsStack - 'http.socket.buffer-size': null
[DEBUG] ClientParamsStack - 'http.protocol.element-charset': null
[DEBUG] ClientParamsStack - 'http.connection.max-line-length': null
[DEBUG] ClientParamsStack - 'http.protocol.element-charset': null
[DEBUG] ClientParamsStack - 'http.connection.max-header-count': null
[DEBUG] ClientParamsStack - 'http.connection.max-line-length': null
[DEBUG] ClientParamsStack - 'http.connection.max-status-line-garbage': null
[DEBUG] ClientParamsStack - 'http.protocol.version': HTTP/1.1
[DEBUG] ClientParamsStack - 'http.useragent': Apache-HttpClient/4.0-beta1
(java 1.4)
[DEBUG] wire - >> "CONNECT www.verisign.com:443 HTTP/1.1[EOL]"
[DEBUG] wire - >> "User-Agent: Apache-HttpClient/4.0-beta1 (java 1.4)[EOL]"
[DEBUG] wire - >> "Proxy-Authorization: NTLM
TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAwADABwAAAACAAIAHwAAAAOAA4AhAAAAAAAAAAA
AAAAAQIAAOOOenVD3rqAqXU7pJjbK5QyfrCD58Nj97AldWYk//1QtLyNjRSYH89g7e4f95Vx0lAA
TQBCAEUATABaAGMAZQBjAGgAUABDAC0AMQA2ADMANAA=[EOL]"
[DEBUG] wire - >> "[EOL]"
[DEBUG] headers - >> CONNECT www.verisign.com:443 HTTP/1.1
[DEBUG] headers - >> User-Agent: Apache-HttpClient/4.0-beta1 (java 1.4)
[DEBUG] headers - >> Proxy-Authorization: NTLM
TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAwADABwAAAACAAIAHwAAAAOAA4AhAAAAAAAAAAA
AAAAAQIAAOOOenVD3rqAqXU7pJjbK5QyfrCD58Nj97AldWYk//1QtLyNjRSYH89g7e4f95Vx0lAA
TQBCAEUATABaAGMAZQBjAGgAUABDAC0AMQA2ADMANAA=
[DEBUG] wire - << "HTTP/1.0 407 Proxy Authentication Required[EOL]"
[DEBUG] wire - << "Server: squid/2.6.STABLE6-NT[EOL]"
[DEBUG] wire - << "Date: Wed, 29 Oct 2008 07:36:24 GMT[EOL]"
[DEBUG] wire - << "Content-Type: text/html[EOL]"
[DEBUG] wire - << "Content-Length: 1347[EOL]"
[DEBUG] wire - << "Expires: Wed, 29 Oct 2008 07:36:24 GMT[EOL]"
[DEBUG] wire - << "X-Squid-Error: ERR_CACHE_ACCESS_DENIED 0[EOL]"
[DEBUG] wire - << "Proxy-Authenticate: NTLM[EOL]"
[DEBUG] wire - << "X-Cache: MISS from s-hqw2k3bd.pmbelz.de[EOL]"
[DEBUG] wire - << "X-Cache-Lookup: NONE from s-hqw2k3bd.pmbelz.de:3128[EOL]"
[DEBUG] wire - << "Via: 1.0 s-hqw2k3bd.pmbelz.de:3128
(squid/2.6.STABLE6-NT)[EOL]"
[DEBUG] wire - << "Proxy-Connection: close[EOL]"
[DEBUG] headers - << HTTP/1.0 407 Proxy Authentication Required
[DEBUG] headers - << Server: squid/2.6.STABLE6-NT
[DEBUG] headers - << Date: Wed, 29 Oct 2008 07:36:24 GMT
[DEBUG] headers - << Content-Type: text/html
[DEBUG] headers - << Content-Length: 1347
[DEBUG] headers - << Expires: Wed, 29 Oct 2008 07:36:24 GMT
[DEBUG] headers - << X-Squid-Error: ERR_CACHE_ACCESS_DENIED 0
[DEBUG] headers - << Proxy-Authenticate: NTLM
[DEBUG] headers - << X-Cache: MISS from s-hqw2k3bd.pmbelz.de
[DEBUG] headers - << X-Cache-Lookup: NONE from s-hqw2k3bd.pmbelz.de:3128
[DEBUG] headers - << Via: 1.0 s-hqw2k3bd.pmbelz.de:3128
(squid/2.6.STABLE6-NT)
[DEBUG] headers - << Proxy-Connection: close
[INFO] ResponseProcessCookies - CookieSpec not available in HTTP context
[DEBUG] ClientParamsStack - 'http.protocol.handle-authentication': null
[DEBUG] DefaultRequestDirector - Proxy requested authentication
[DEBUG] DefaultRequestDirector - Authorization challenge processed
[DEBUG] DefaultRequestDirector - Authentication scope: NTLM <any
realm>@s-hqw2k3bd:3128
[DEBUG] DefaultRequestDirector - Authentication failed
[DEBUG] wire - << "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">[\r][\n]"
[DEBUG] wire - << "<HTML><HEAD><META HTTP-EQUIV="Content-Type"
CONTENT="text/html; charset=iso-8859-1">[\r][\n]"
[DEBUG] wire - << "<TITLE>ERROR: Cache Access Denied</TITLE>[\r][\n]"
[DEBUG] wire - << "<STYLE
type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-s
erif}PRE{font-family:sans-serif}--></STYLE>[\r][\n]"
[DEBUG] wire - << "</HEAD>[\r][\n]"
[DEBUG] wire - << "<BODY>[\r][\n]"
[DEBUG] wire - << "<H1>ERROR</H1>[\r][\n]"
[DEBUG] wire - << "<H2>Cache Access Denied</H2>[\r][\n]"
[DEBUG] wire - << "<HR noshade size="1px">[\r][\n]"
[DEBUG] wire - << "<P>[\r][\n]"
[DEBUG] wire - << "While trying to retrieve the URL:[\r][\n]"
[DEBUG] wire - << "<A
HREF="www.verisign.com:443">www.verisign.com:443</A>[\r][\n]"
[DEBUG] wire - << "<P>[\r][\n]"
[DEBUG] wire - << "The following error was encountered:[\r][\n]"
[DEBUG] wire - << "<UL>[\r][\n]"
[DEBUG] wire - << "<LI>[\r][\n]"
[DEBUG] wire - << "<STRONG>[\r][\n]"
[DEBUG] wire - << "Cache Access Denied.[\r][\n]"
[DEBUG] wire - << "</STRONG>[\r][\n]"
[DEBUG] wire - << "</UL>[\r][\n]"
[DEBUG] wire - << "</P>[\r][\n]"
[DEBUG] wire - << "[\r][\n]"
[DEBUG] wire - << "<P>Sorry, you are not currently allowed to
request:[\r][\n]"
[DEBUG] wire - << "<PRE>    www.verisign.com:443</PRE>[\r][\n]"
[DEBUG] wire - << "from this cache until you have authenticated
yourself.[\r][\n]"
[DEBUG] wire - << "</P>[\r][\n]"
[DEBUG] wire - << "[\r][\n]"
[DEBUG] wire - << "<P>[\r][\n]"
[DEBUG] wire - << "You need to use Netscape version 2.0 or greater, or
Microsoft Internet[\r][\n]"
[DEBUG] wire - << "Explorer 3.0, or an HTTP/1.1 compliant browser for this
to work.  Please[\r][\n]"
[DEBUG] wire - << "contact the <A HREF="mailto:webmaster">cache
administrator</a> if you have[\r][\n]"
[DEBUG] wire - << "difficulties authenticating yourself or [\r][\n]"
[DEBUG] wire - << "<A
HREF="http://s-hqw2k3bd.pmbelz.de/cgi-bin/chpasswd.cgi">change</a> your
default password.[\r][\n]"
[DEBUG] wire - << "</P>[\r][\n]"
[DEBUG] wire - << "[\n]"
[DEBUG] wire - << "<BR clear="all">[\n]"
[DEBUG] wire - << "<HR noshade size="1px">[\n]"
[DEBUG] wire - << "<ADDRESS>[\n]"
[DEBUG] wire - << "Generated Wed, 29 Oct 2008 07:36:24 GMT by
s-hqw2k3bd.pmbelz.de (squid/2.6.STABLE6-NT)[\n]"
[DEBUG] wire - << "</ADDRESS>[\n]"
[DEBUG] wire - << "</BODY></HTML>[\n]"
[DEBUG] DefaultClientConnection - Connection closed
[DEBUG] DefaultRequestDirector - CONNECT refused by proxy: HTTP/1.0 407
Proxy Authentication Required
[DEBUG] SingleClientConnManager - Releasing connection
org.apache.http.impl.conn.SingleClientConnManager$ConnAdapter@1975b59
----------------------------------------
HTTP/1.0 407 Proxy Authentication Required
Response content length: 1347
----------------------------------------
HTTP/1.0 407 Proxy Authentication Required
Server: squid/2.6.STABLE6-NT
Date: Wed, 29 Oct 2008 07:36:24 GMT
Content-Type: text/html
Content-Length: 1347
Expires: Wed, 29 Oct 2008 07:36:24 GMT
X-Squid-Error: ERR_CACHE_ACCESS_DENIED 0
Proxy-Authenticate: NTLM
X-Cache: MISS from s-hqw2k3bd.pmbelz.de
X-Cache-Lookup: NONE from s-hqw2k3bd.pmbelz.de:3128
Via: 1.0 s-hqw2k3bd.pmbelz.de:3128 (squid/2.6.STABLE6-NT)
Proxy-Connection: close
----------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html;
charset=iso-8859-1">
<TITLE>ERROR: Cache Access Denied</TITLE>
<STYLE
type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-s
erif}PRE{font-family:sans-serif}--></STYLE>
</HEAD>
<BODY>
<H1>ERROR</H1>
<H2>Cache Access Denied</H2>
<HR noshade size="1px">
<P>
While trying to retrieve the URL:
<A HREF="www.verisign.com:443">www.verisign.com:443</A>
<P>
The following error was encountered:
<UL>
<LI>
<STRONG>
Cache Access Denied.
</STRONG>
</UL>
</P>

<P>Sorry, you are not currently allowed to request:
<PRE>    www.verisign.com:443</PRE>
from this cache until you have authenticated yourself.
</P>

<P>
You need to use Netscape version 2.0 or greater, or Microsoft Internet
Explorer 3.0, or an HTTP/1.1 compliant browser for this to work.  Please
contact the <A HREF="mailto:webmaster">cache administrator</a> if you have
difficulties authenticating yourself or 
<A HREF="http://s-hqw2k3bd.pmbelz.de/cgi-bin/chpasswd.cgi">change</a> your
default password.
</P>

<BR clear="all">
<HR noshade size="1px">
<ADDRESS>
Generated Wed, 29 Oct 2008 07:36:24 GMT by s-hqw2k3bd.pmbelz.de
(squid/2.6.STABLE6-NT)
</ADDRESS>
</BODY></HTML>






-----Urspr√ľngliche Nachricht-----
Von: Oleg Kalnichevski [mailto:olegk@apache.org] 
Gesendet: Dienstag, 28. Oktober 2008 21:39
An: HttpClient User Discussion
Betreff: Re: NTLM-Proxy authentication and SSL-target

On Mon, 2008-10-27 at 15:46 +0100, Cech. Ulrich wrote:
> Hello,
> 
> I have a problem with SSL target over a proxy. I use the example of 
> the HttpClient-code (4.0 beta), without an SSL-target, everything work
fine.
> But if I change the target to port 443 and https (s. commented line), 
> I receive the "HTTP/1.0 407 Proxy Authentication Required" from the 
> proxy (and nothing else as a hint).
> NTLM is not the problem, because authentication works with an 
> un-SSL-ed target.
> There is no certificate error (and the certificate is installed 
> correctly), and the site is displayed well in the normal browser (IE 
> and Firefox tested).
> 
> Has someone a hint, where the problem is?
> 
> Thanks in advance,
> Ulrich
> 

Ulrich

I assume you have followed the instructions of the NTLM guide:

http://hc.apache.org/httpcomponents-client/ntlm.html

If that is the case, could you please produce a context / wire log of the
session that exhibits the problem? 

You need to pass the following settings to the JVM to activate the logs

-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
-Dorg.apache.commons.logging.simplelog.log.org.apache.http=DEBUG

Oleg

> 
> Here is the main-method from the example-class:
> 
> 
>     public static void main(String[] args) throws Exception {
>         
>         DefaultHttpClient httpclient = new DefaultHttpClient();
> 
>         httpclient.getAuthSchemes().register("NTLM", new 
> NTLMSchemeFactory());
>         httpclient.getCredentialsProvider().setCredentials(
>                 new AuthScope(AuthScope.ANY), 
>                 new NTCredentials(user, pw, workstation, domain));
> 
>         //HttpHost targetHost = new HttpHost("www.verisign.com", 443, 
> "https");
>         HttpHost targetHost = new HttpHost("www.verisign.com", 80, 
> "http");
>         
> 	  HttpHost proxy = new HttpHost("s-hqw2k3bd", 3128);
> 
>         httpclient.getParams().setParameter
>             (ConnRoutePNames.DEFAULT_PROXY, proxy);
> 
>         HttpGet httpget = new HttpGet("/");
>         
>         System.out.println("executing request: " + 
> httpget.getRequestLine());
>         System.out.println("via proxy: " + proxy);
>         System.out.println("to target: " + targetHost);
>         
>         HttpResponse response = httpclient.execute(targetHost, httpget);
>         HttpEntity entity = response.getEntity();
> 
>         System.out.println("----------------------------------------");
>         System.out.println(response.getStatusLine());
>         if (entity != null) {
>             System.out.println("Response content length: " + 
> entity.getContentLength());
>         }
>         if (entity != null) {
>             entity.consumeContent();
>         }
>     }
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
> 


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


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


Mime
View raw message