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


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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to