hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Souza <rick.so...@digitro.com.br>
Subject Problems with Https and Proxy
Date Tue, 12 Feb 2008 12:03:11 GMT
Hi, I'm trying to use the postmethod to conect a https site, but i need 
to conect the proxy first.
So I put the host, port, login and pass to connect and I see that 
everything is ok. When i try
to connect the https site, the error comes:  Connection is not Open!
But, if i try to connect any http site, it doesn't comes with error.
I'm trying this at the company that I work. When I test it at home, I 
can connect to the
https site without any error. I think that is happening because there's 
something wrong
with the proxy.

I'm gonna paste some part of the code:

        ...
        HttpClient client = new HttpClient();
       
        client.getHostConfiguration().setProxy("proxy", port);
        client.getState().setProxyCredentials(AuthScope.ANY,
                new UsernamePasswordCredentials("user", "pass"));

        PostMethod method = new PostMethod(url);

        method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,
        new DefaultHttpMethodRetryHandler(3, false));

        
method.getParams().setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY);

        method.addParameter("user","user");
        method.addParameter("pass","pass");
        try {
        int status = client.executeMethod(method);
       ...

I can't understand what's wrong here.
I get the error when he try to execute the method post. The last line i 
paste here.

      


---------------------------------------------------------------------
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