Application.close() not working behind ssl proxy

Hi all,

I have a Vaadin application running on Jetty which is reachable (plain http connection) through a proxy (https connection); basically we have:

client <—(https)—> lighttpd + mod_proxy <—(http)—> jetty

Everything works fine, except when calling Application.logout() which reloads the application to http://my.domain:myPort instead of https://my.domain:myPort. So, the original protocol part gets lost (but domain and port are kept).

I know I could nat a port to Jetty and simplify the above connection. But, since I have to do things that way, is there a way to circumvent this problem?

Thanks a lot,

Marco

Replying to myself :slight_smile:

I managed to get things to work:

  1. Set a configuration parameter in a .properties file:
    useHttpsOnLogout = YES / NO / AUTOMATIC.

  2. Retrieve the application’s url:
    logoutUrl = application.getURL().toString.

  3. Replace the protocol part, if needed:
    if (“YES”.equalsIgnoreCase(useHttpsOnLogout)) {
    logoutUrl = logoutUrl.replace(“http://”, “https://”);
    }
    else if (“NO”.equalsIgnoreCase(useHttpsOnLogout)) {
    logoutUrl = logoutUrl.replace(“https://”, “http://”);
    }

Marco