I want to force all users to use SSL for all pages in my application. I am using mavan 3 and used this plugin in maven:
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0-SNAPSHOT</version>
<configuration>
<server>TomcatServer</server>
<httpsPort>8443</httpsPort>
<keystoreFile>-- My keystore path --</keystoreFile>
<keystorePass>-- My keystore pass --</keystorePass>
<path>/</path>
</configuration>
</plugin>
On running the server through maven (mvn tomcat7:run), my server logs are like this:
...
INFO: Initializing Spring root WebApplicationContext
Sep 16, 2012 9:55:17 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Sep 16, 2012 9:55:17 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8443"]
However, when I access the page with https, I get SSL connection error in chrome and "SSL received a record that exceeded the maximum permissible length." in firefox.
1) I believe maven embeds Tomcat 7 in the war. So, there is no server.xml file where I can manually configure SSL. How can I configure SSL in my pom.xml?
2) How to make sure that all requests get forwarded to 8443?