What does the debug output look like ?
You can turn on debugging with the following code:
System.setProperty("org.apache.commons.logging.Log",
"org.apache.commons.logging.impl.SimpleLog");
System.setProperty("org.apache.commons.logging.simplelog.showdatetime",
"true");
System.setProperty("org.apache.commons.logging.simplelog.log.httpclient.wire.header",
"debug");
System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.commons.httpclient",
"debug");
-Steve More
On Tue, Feb 12, 2008 at 7:03 AM, Rick Souza <rick....r> wrote:
> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]