Skip to main content

https with port 443

5 replies [Last post]
hovan
Offline
Joined: 2009-04-27
Points: 0

Any body know about this? Jmaki not able to load the widget properly if ssl enabled on port 443 (any other port is ok).

What i am thinking is: the resource URL generated include the 443 in there which doesn't match the one on the browser. any help on this will be appreciated.

Thanks,

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
gmurray71
Offline
Joined: 2003-07-31
Points: 0

Hi,

Are you loading the widget from a page rendered from port 443?

Browsers for security reasons have to load data from the same domain / port.

What version of jMaki are you using?

Hopefully we can track this down pretty easy.

-G

hovan
Offline
Joined: 2009-04-27
Points: 0

it's 1.8.1. I couldn't find the source code to fix, so did a hack in AjaxContent.class add this code in will be good.

boolean includePort = true;
if ("http".equals(getScheme()) && (request.getServerPort() == 80)) {
includePort = false;
}
if ("https".equals(getScheme()) && (request.getServerPort() == 443)) {
includePort = false;
}
//append the port if need to
if(includePort) {
webRootBuffer.append(":").append(request.getServerPort());
}

Please let me know if u have a real fix.
Thanks

hovan
Offline
Joined: 2009-04-27
Points: 0

it's in getWebRoot() method

gmurray71
Offline
Joined: 2003-07-31
Points: 0

I believe the following code will achieve the same results of not including the port for https:

if (request.getServerPort() != 80 && !("https".equals(getScheme()) {
webRootBuffer.append(":").append(request.getServerPort());
}

If you think this will work for you let me know and I'll put back the code.

An interim solution would be to set a context level webroot as a context parameter in your web.xml

jmaki-https-webroot http://myhost.com/foo

Thank you for pointing this issue out.

-Greg

hovan
Offline
Joined: 2009-04-27
Points: 0

mine is working but your maybe not. just want to fix if https & 443 => don't include the port
and it nice if 80 not include port (which u already did). Any other https port => should include the port in there.

Yeah, context parameter is find but doesn't give much flexibility when deploy the application.

Thanks for the reply. Btw can i source code download some where?