Book Image

Spring Boot Cookbook

By : Alex Antonov
Book Image

Spring Boot Cookbook

By: Alex Antonov

Overview of this book

Table of Contents (15 chapters)
Spring Boot Cookbook
Credits
About the Author
Acknowledgment
About the Reviewers
www.PacktPub.com
Preface
Index

Adding custom connectors


Another very common scenario in the enterprise application development and deployment is to run the application with two separate HTTP port connectors: one for HTTP and the other for HTTPS.

Getting ready

We will start by going back to using Tomcat; so for this recipe, we will undo the changes that we implemented in the previous example.

In order to create an HTTPS connector, we will need a few things; but most importantly, we will need to generate Certificate keystore that is used to encrypt and decrypt the SSL communication with the browser.

If you are using Unix or Mac, you can do it by running the following command:

$JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA

On Windows, this could be achieved via the following code:

"%JAVA_HOME%\bin\keytool" -genkey -alias tomcat -keyalg RSA

During the creation of the keystore, you should enter the information that is appropriate to you, including passwords, name, and so on. For the purpose of this book, we will use...