Hi,

> The sympthom is that super.getDesiredSchemeFor(pageClass) always returns HTTP
> regardless https or http is in the url.
>
> Scheme sm=super.getDesiredSchemeFor(pageClass);

did you annotate your pageClass with RequireHttps? Whether HTTPS is desired, does not depend on the scheme of the incoming url.

Regards
Sven

On 17.09.2015 11:50, Sandor Feher wrote:
Hi,

I don't know is it the appropriate channel I should ask but I hope somebody
can give me a pointer.
The sympthom is that super.getDesiredSchemeFor(pageClass) always returns
HTTP regardless https or http is in the url.
If I force Scheme.HTTPS then everything works fine.


TIA., Sandor

-------------------------------------------------------------------------------------------------------------
servlet.xml looks like this:

<Connector port="8080" protocol="HTTP/1.1"
                connectionTimeout="20000"
                           enableLookups="false"
                redirectPort="443" />
     <Connector port="80" protocol="HTTP/1.1"
                connectionTimeout="20000"
                           enableLookups="false"
                redirectPort="443" />
     <Connector executor="tomcatThreadPool"
                port="8080" protocol="HTTP/1.1"
                connectionTimeout="20000"
                redirectPort="443" />

     <Connector port="443"
protocol="org.apache.coyote.http11.Http11AprProtocol"
                maxThreads="150" SSLEnabled="true" scheme="https"
secure="true"
SSLCertificateFile="C:\apache-tomcat-7.0.64\conf\wildcard_hok-plastic_com.crt" SSLCertificateKeyFile="C:\apache-tomcat-7.0.64\conf\wildcard_hok-plastic_com.key"
                clientAuth="false" sslProtocol="TLS" />

     <Connector port="8009" protocol="AJP/1.3" redirectPort="443" />


My Application's relevant part is this:

setRootRequestMapper(new HttpsMapper(getRootRequestMapper(), new
HttpsConfig()) {

                 @Override
                 protected Scheme getDesiredSchemeFor(Class<? extends
IRequestablePage> pageClass) {
                     if (getConfigurationType() ==
RuntimeConfigurationType.DEVELOPMENT) {
                         LOG.info("Dev mode, always use HTTP");
                         return Scheme.HTTP;
                     } else {
Scheme sm=super.getDesiredSchemeFor(pageClass);
                         sm=Scheme.HTTPS;
                         LOG.info("not in development mode "+sm.name());
                         return sm;
                     }
                 }

             });


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Tomcat-7-SSL-and-getDesiredSchemeFor-problem-tp4671980.html
Sent from the Users forum mailing list archive at Nabble.com.

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



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

Reply via email to