So far, we have built up an application with method-level security, alternate profiles of dev and production configuration, and wired up a MySQL server with Spring Security data loaded through Spring Boot scripts. The final touch to make our application secure from end to end would be to switch on SSL in the embedded Tomcat server.
Security is a multilevel process. Protecting assets with username / password / role controls is inadequate if anyone can snoop the network and steal credentials. Let's see how to prevent this.
The following class,
SecureTomcatConfiguration, shows us how to create two Tomcat connectors. One is for unsecured HTTP on port 8080, and the other is for secured HTTPS on port 8443: