You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Rangel Preis <ra...@gmail.com> on 2009/11/10 20:01:14 UTC

Proxying SSL on Apache to HTTP on Jetty + Wicket

The situation here is:

https                          http
--------->   Apache   -------> Jetty


Using wicket in my WicketApplication I put

  private static final HttpsConfig HTTPS_CONFIG = new
HttpsConfig(HTTP_PORT, HTTPS_PORT);

    @Override
    protected IRequestCycleProcessor newRequestCycleProcessor() {
        return new HttpsRequestCycleProcessor(HTTPS_CONFIG);
    }

And in my LoginPage.java i have @RequireHttps

When i try to run the system with this config i get a error because
Wicket assumes the HTTPS control and try to change the URL (port and
replace http to https)

How i say to wicket to just change the protocol to HTTPS? And don't
change the port?

Thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Proxying SSL on Apache to HTTP on Jetty + Wicket

Posted by Rangel Preis <ra...@gmail.com>.
Thanks Nino, you are correct.

In the Jetty tutorial says:

"...extending the Connector class of your choice, eg the
SelectChannelConnector, and implement the customize..."

public void customize(org.mortbay.io.EndPoint endpoint, Request
request) throws IOException
{
    request.setScheme("https");
    super.customize(endpoint, request);
}

but this don't work and i change to:

    public void customize(final EndPoint endpoint, final Request
request) throws IOException {
        super.customize(endpoint, request);
        if ("https".equals(request.getHeader("scheme"))) {
            request.setScheme("https");
        }
    }

Now this works. Thanks Nino.



2009/11/11 nino martinez wael <ni...@gmail.com>:
> I think last time this came up it ended out being some issue with jetty?
>
> 2009/11/11 Rangel Preis <ra...@gmail.com>
>
>> I extends HttpsRequestCycleProcessor and SwitchProtocolRequestTarget
>> to make my custom HttpsRequestCycleProcessor....
>> In the method getUrl from SwitchProtocolRequestTarget i just remove the
>> port:
>>
>>         if (port != null) {
>>          result.append(":");
>>          result.append(port);
>>         }
>>
>> But don't work, the url are correct but the page don't load i think i
>> miss something in apache.
>>
>> Anyone make something like this?
>>
>> Thanks.
>>
>> 2009/11/10 Rangel Preis <ra...@gmail.com>:
>> > The unique solution that i found is extends HttpsRequestCycleProcessor
>> > to change only the protocol.
>> >
>> > Any other ideia? Thanks All.
>> >
>> > 2009/11/10 Rangel Preis <ra...@gmail.com>:
>> >> The situation here is:
>> >>
>> >> https                          http
>> >> --------->   Apache   -------> Jetty
>> >>
>> >>
>> >> Using wicket in my WicketApplication I put
>> >>
>> >>  private static final HttpsConfig HTTPS_CONFIG = new
>> >> HttpsConfig(HTTP_PORT, HTTPS_PORT);
>> >>
>> >>    @Override
>> >>    protected IRequestCycleProcessor newRequestCycleProcessor() {
>> >>        return new HttpsRequestCycleProcessor(HTTPS_CONFIG);
>> >>    }
>> >>
>> >> And in my LoginPage.java i have @RequireHttps
>> >>
>> >> When i try to run the system with this config i get a error because
>> >> Wicket assumes the HTTPS control and try to change the URL (port and
>> >> replace http to https)
>> >>
>> >> How i say to wicket to just change the protocol to HTTPS? And don't
>> >> change the port?
>> >>
>> >> Thanks
>> >>
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Proxying SSL on Apache to HTTP on Jetty + Wicket

Posted by nino martinez wael <ni...@gmail.com>.
I think last time this came up it ended out being some issue with jetty?

2009/11/11 Rangel Preis <ra...@gmail.com>

> I extends HttpsRequestCycleProcessor and SwitchProtocolRequestTarget
> to make my custom HttpsRequestCycleProcessor....
> In the method getUrl from SwitchProtocolRequestTarget i just remove the
> port:
>
>         if (port != null) {
>          result.append(":");
>          result.append(port);
>         }
>
> But don't work, the url are correct but the page don't load i think i
> miss something in apache.
>
> Anyone make something like this?
>
> Thanks.
>
> 2009/11/10 Rangel Preis <ra...@gmail.com>:
> > The unique solution that i found is extends HttpsRequestCycleProcessor
> > to change only the protocol.
> >
> > Any other ideia? Thanks All.
> >
> > 2009/11/10 Rangel Preis <ra...@gmail.com>:
> >> The situation here is:
> >>
> >> https                          http
> >> --------->   Apache   -------> Jetty
> >>
> >>
> >> Using wicket in my WicketApplication I put
> >>
> >>  private static final HttpsConfig HTTPS_CONFIG = new
> >> HttpsConfig(HTTP_PORT, HTTPS_PORT);
> >>
> >>    @Override
> >>    protected IRequestCycleProcessor newRequestCycleProcessor() {
> >>        return new HttpsRequestCycleProcessor(HTTPS_CONFIG);
> >>    }
> >>
> >> And in my LoginPage.java i have @RequireHttps
> >>
> >> When i try to run the system with this config i get a error because
> >> Wicket assumes the HTTPS control and try to change the URL (port and
> >> replace http to https)
> >>
> >> How i say to wicket to just change the protocol to HTTPS? And don't
> >> change the port?
> >>
> >> Thanks
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Browser back, Panel replacement

Posted by bh...@actrix.gen.nz.
Hi,

I have been using panel replacement instead of multiple different
pages as a way to avoid a kind of back button problem but I am not
happy with my solution.

The objective is to prevent the user from going back after an update
to previous pages/versions of the page containing state of domain data
which really does not exist anymore.

This worked without AJAX when using HybridUrlCodingStrategy.

Because of a high number of pages, I want to get away from any
WebRequestCodingStrategy because of the Performance hint in
IRequestTargetUrlCodingStrategy#getMountEncoder. I don't mind ugly
URLs.  When I remove the HybridUrlCodingStrategy then the approach
does not seem to work anymore.

Also I am suspicous of any missing panel crashes on navigation with
the panel replacement approach.

How can I meet my objective? Is there a Wicket best practice approach
for this? I feel I am running round in circles considering options
such as IRequestCycleSettings.RenderStrategy, setVersioned(false).

My possibly oversimplified thought is that Wicket keeps changing page
state on the server and via HTTP post redirect back to the same page
there would never be a browser back option because the same page
cannot have multiple subsequent entries in the browser history.

I feel that this is such an obvious and common problem - I hope this
has already been written about and I just missed the article.


Many thanks,

Bernard

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Proxying SSL on Apache to HTTP on Jetty + Wicket

Posted by Rangel Preis <ra...@gmail.com>.
I extends HttpsRequestCycleProcessor and SwitchProtocolRequestTarget
to make my custom HttpsRequestCycleProcessor....
In the method getUrl from SwitchProtocolRequestTarget i just remove the port:

         if (port != null) {
          result.append(":");
          result.append(port);
         }

But don't work, the url are correct but the page don't load i think i
miss something in apache.

Anyone make something like this?

Thanks.

2009/11/10 Rangel Preis <ra...@gmail.com>:
> The unique solution that i found is extends HttpsRequestCycleProcessor
> to change only the protocol.
>
> Any other ideia? Thanks All.
>
> 2009/11/10 Rangel Preis <ra...@gmail.com>:
>> The situation here is:
>>
>> https                          http
>> --------->   Apache   -------> Jetty
>>
>>
>> Using wicket in my WicketApplication I put
>>
>>  private static final HttpsConfig HTTPS_CONFIG = new
>> HttpsConfig(HTTP_PORT, HTTPS_PORT);
>>
>>    @Override
>>    protected IRequestCycleProcessor newRequestCycleProcessor() {
>>        return new HttpsRequestCycleProcessor(HTTPS_CONFIG);
>>    }
>>
>> And in my LoginPage.java i have @RequireHttps
>>
>> When i try to run the system with this config i get a error because
>> Wicket assumes the HTTPS control and try to change the URL (port and
>> replace http to https)
>>
>> How i say to wicket to just change the protocol to HTTPS? And don't
>> change the port?
>>
>> Thanks
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Proxying SSL on Apache to HTTP on Jetty + Wicket

Posted by Rangel Preis <ra...@gmail.com>.
The unique solution that i found is extends HttpsRequestCycleProcessor
to change only the protocol.

Any other ideia? Thanks All.

2009/11/10 Rangel Preis <ra...@gmail.com>:
> The situation here is:
>
> https                          http
> --------->   Apache   -------> Jetty
>
>
> Using wicket in my WicketApplication I put
>
>  private static final HttpsConfig HTTPS_CONFIG = new
> HttpsConfig(HTTP_PORT, HTTPS_PORT);
>
>    @Override
>    protected IRequestCycleProcessor newRequestCycleProcessor() {
>        return new HttpsRequestCycleProcessor(HTTPS_CONFIG);
>    }
>
> And in my LoginPage.java i have @RequireHttps
>
> When i try to run the system with this config i get a error because
> Wicket assumes the HTTPS control and try to change the URL (port and
> replace http to https)
>
> How i say to wicket to just change the protocol to HTTPS? And don't
> change the port?
>
> Thanks
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org