logo
Apache Lounge
Webmasters

 


About

Forum Index Downloads Search Register Log in  RSS Apache Lounge
 



Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Apache Lounge is not sponsored.

Your donations will help to keep this site alive and well, and continuing building binaries.



HTTPS Response is not coming in Applet

 
Post new topic   Reply to topic    Apache Forum Index -> Coding & Scripting Corner



View previous topic :: View next topic  
Author Message
sonu131



Joined: 11 Sep 2006
Posts: 2

PostPosted: Mon 11 Sep '06 7:38    Post subject: HTTPS Response is not coming in Applet Reply with quote

I have following configured and working with HTTP (no problem)
Apache/2.0.59 (Win32) mod_jk/1.2.18 mod_ssl/2.0.59 OpenSSL/0.9.8b

But when I use HTTPS, following applet code is having nothing in the inputstream

url = new URL(getServerURL() + "/ejbproxy.do");
urlConn = (HttpURLConnection)url.openConnection();
urlConn.setDoInput(true);
urlConn.setDoOutput(true);
urlConn.setUseCaches(false);
urlConn.connect();
OutputStreamWriter osw = new OutputStreamWriter(urlConn.getOutputStream());
osw.write(EJBProxyUtils.HOME_NAME + "=" + homeName);
osw.write("&" + EJBProxyUtils.HOME_METHOD_NAME + "=" + homeMethodName);

int statusCode = urlConn.getResponseCode();
System.out.println("statusCode "+statusCode);\\this is getting printed up.
if (statusCode == HttpURLConnection.HTTP_OK)
{
InputStream is = urlConn.getInputStream();
if (is.available() > 0)
{
}
else
{
System.out.println("got nothing");\\this always getting printed up in case of https.
}

}

All https request-response via apache from IE browser (client) is going on correctly, the only issue is when I am sending https (http is working) request via applet.
Also the access log of webserver is showing status 200 with 20 bytes in response and ssl_request_log at apache is showing correct response with same bytes but its not coming to applet (client).
Application server is Jboss 4.0.3SP1

Further, this only happening in case I am going via apache but when I am directly hitting my app server everything works fine.
can anybody help me here ?
Back to top
sonu131



Joined: 11 Sep 2006
Posts: 2

PostPosted: Mon 11 Sep '06 19:26    Post subject: Reply with quote

do any body encountered the same issue while working with html pages as wel as applets in html and faced issue while communicating through applet but not with HTML forms in the IE.

so the question is why is it happening in applet-servlet communication only and that too with https and not with http.

amy i missing something in the configuration of open ssl.
Back to top
etan



Joined: 15 Mar 2012
Posts: 3

PostPosted: Thu 15 Mar '12 8:40    Post subject: Reply with quote

I encountered this problem. Did you manage to find a workaround or solution for this problem? Thanks.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 6255
Location: Germany, Next to Hamburg

PostPosted: Thu 15 Mar '12 21:25    Post subject: Reply with quote

Are you sure you getting the right url with getServerURL() ? Does it also have the https:// prefix? I could be that it just return the server name and tries to connect. Than the browser won't allow an applet on a https page to connect to http something.

Second thing, is you connector able to establish a SSL connection?
Back to top
etan



Joined: 15 Mar 2012
Posts: 3

PostPosted: Fri 16 Mar '12 11:03    Post subject: Reply with quote

For my case, I'm using getCodeBase() to get the URL.
URL url = new URL(getCodeBase(), "testServlet");

When I connect via Apache (e.g. https://www.test.com), I can get urlConn.getContentLength() but the is.available() is always returning 0. However, if I connect directly to JBoss server (e.g. https://www.test.com:4443), I can get both urlConn.getContentLength() and is.available().
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 6255
Location: Germany, Next to Hamburg

PostPosted: Fri 16 Mar '12 14:51    Post subject: Reply with quote

Do you connect to the JBoss over mod_jk or mod_proxy_ajp or directly with the applet?
Back to top
etan



Joined: 15 Mar 2012
Posts: 3

PostPosted: Tue 20 Mar '12 14:01    Post subject: Reply with quote

We have a rewrite to force all http connections to redirect to https connections.
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

We are using mod_proxy to redirect to JBoss SSL port (i.e. 4443).
ProxyPass / https://localhost:4443/
ProxyPassReverse / https://localhost:4443/
Back to top


Post new topic   Reply to topic    Apache Forum Index -> Coding & Scripting Corner
Page 1 of 1