You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Coulter Karen <ka...@architechcorp.com> on 2005/01/12 19:28:00 UTC
Problem with SSL login (may be a server-side proxy???)
Thanks for the help in advance. I'm new at this. I'm trying to log on to a secure site via HttpClient. This works through a browser, but not thru HttpClient. Below is the stack trace and code I'm trying to execute. The writeRequest is getting through but the readResponse is failing. I have attached my trace log as well as 2 files showing the Ethereal trace using HttpClient and using the browser.
--Karen
HttpClient client = new HttpClient();
PostMethod authpost = null;
try {
authpost = new PostMethod("https://egwxea.bellatlantic.com/proxyplugin/login.loginproc");
NameValuePair userName = new NameValuePair("usr", "xxxxxxxx");
NameValuePair pwd = new NameValuePair("password", "xxxxxxxx");
NameValuePair redturl = new NameValuePair("redturl", "");
NameValuePair submit = new NameValuePair("SUBMIT", "Continue");
authpost.setRequestBody(new NameValuePair[] {userName,pwd,redturl,submit});
client.executeMethod(authpost);
} finally {
authpost.releaseConnection();
}
org.apache.commons.httpclient.NoHttpResponseException: The server egwxea.bellatlantic.com failed to respond
at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1828)
at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1588)
at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:999)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:382)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:168)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:393)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:324)
at WisorScreenScrapeMain.doVerizon(WisorScreenScrapeMain.java:86)
at WisorScreenScrapeMain.main(WisorScreenScrapeMain.java:32)
Exception in thread "main"
Re: Problem with SSL login (may be a server-side proxy???)
Posted by Julius Davies <ju...@cucbc.com>.
Hi, Karen,
Try adding this header to your request before you execute it:
Content-Type: application/x-www-form-urlencoded
Like so:
authpost.setRequestHeader( "content-type", "application/x-www-form-urlencoded" );
yours,
Julius
On Wed, 2005-12-01 at 12:28 -0600, Coulter Karen wrote:
> Thanks for the help in advance. I'm new at this. I'm trying to log on to a secure site via HttpClient. This works through a browser, but not thru HttpClient. Below is the stack trace and code I'm trying to execute. The writeRequest is getting through but the readResponse is failing. I have attached my trace log as well as 2 files showing the Ethereal trace using HttpClient and using the browser.
>
> --Karen
>
> HttpClient client = new HttpClient();
>
> PostMethod authpost = null;
>
> try {
>
> authpost = new PostMethod("https://egwxea.bellatlantic.com/proxyplugin/login.loginproc");
>
> NameValuePair userName = new NameValuePair("usr", "xxxxxxxx");
>
> NameValuePair pwd = new NameValuePair("password", "xxxxxxxx");
>
> NameValuePair redturl = new NameValuePair("redturl", "");
>
> NameValuePair submit = new NameValuePair("SUBMIT", "Continue");
>
> authpost.setRequestBody(new NameValuePair[] {userName,pwd,redturl,submit});
>
> client.executeMethod(authpost);
>
> } finally {
>
> authpost.releaseConnection();
>
> }
>
> org.apache.commons.httpclient.NoHttpResponseException: The server egwxea.bellatlantic.com failed to respond
>
> at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1828)
>
> at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1588)
>
> at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:999)
>
> at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:382)
>
> at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:168)
>
> at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:393)
>
> at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:324)
>
> at WisorScreenScrapeMain.doVerizon(WisorScreenScrapeMain.java:86)
>
> at WisorScreenScrapeMain.main(WisorScreenScrapeMain.java:32)
>
> Exception in thread "main"
>
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
Re: Problem with SSL login (may be a server-side proxy???)
Posted by Oleg Kalnichevski <ol...@apache.org>.
Karen,
The Ethereal traces must have got discarded. Could you please try to
resend them?
Oleg
On Wed, 2005-01-12 at 12:28 -0600, Coulter Karen wrote:
> Thanks for the help in advance. I'm new at this. I'm trying to log on to a secure site via HttpClient. This works through a browser, but not thru HttpClient. Below is the stack trace and code I'm trying to execute. The writeRequest is getting through but the readResponse is failing. I have attached my trace log as well as 2 files showing the Ethereal trace using HttpClient and using the browser.
>
> --Karen
>
> HttpClient client = new HttpClient();
>
> PostMethod authpost = null;
>
> try {
>
> authpost = new PostMethod("https://egwxea.bellatlantic.com/proxyplugin/login.loginproc");
>
> NameValuePair userName = new NameValuePair("usr", "xxxxxxxx");
>
> NameValuePair pwd = new NameValuePair("password", "xxxxxxxx");
>
> NameValuePair redturl = new NameValuePair("redturl", "");
>
> NameValuePair submit = new NameValuePair("SUBMIT", "Continue");
>
> authpost.setRequestBody(new NameValuePair[] {userName,pwd,redturl,submit});
>
> client.executeMethod(authpost);
>
> } finally {
>
> authpost.releaseConnection();
>
> }
>
> org.apache.commons.httpclient.NoHttpResponseException: The server egwxea.bellatlantic.com failed to respond
>
> at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1828)
>
> at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1588)
>
> at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:999)
>
> at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:382)
>
> at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:168)
>
> at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:393)
>
> at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:324)
>
> at WisorScreenScrapeMain.doVerizon(WisorScreenScrapeMain.java:86)
>
> at WisorScreenScrapeMain.main(WisorScreenScrapeMain.java:32)
>
> Exception in thread "main"
>
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org