hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alan Yu <ak...@rogers.com>
Subject https proxy authentication error
Date Mon, 27 Feb 2006 23:05:44 GMT
Hi all,

Why the second executeMethod will still get 407?
Thanks.

Alan

=================
HttpClient httpclient = new HttpClient();
httpclient.getHostConfiguration().setProxy("some_proxy",
8443);
GetMethod httpget = new
GetMethod("https://www.verisign.com/");
try {
    int rc = httpclient.executeMethod(httpget);
    switch (rc) {
       case
HttpStatus.SC_PROXY_AUTHENTICATION_REQUIRED:          
                                        
httpclient.getState().setProxyCredentials(AuthScope.ANY,
                       new
UsernamePasswordCredentials("some_id",
"some_password"));                 

     int rc2 = httpclient.executeMethod(httpget);
     System.out.println(rc2);
        break;
    }
} catch (Exception e) {
    e.printStackTrace();
} finally {
    httpget.releaseConnection();
}


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


Mime
View raw message