Generating a server certificate
Some of the chapters sample code (that is, Chapter 8, Client Certificate Authentication with TLS, Chapter 9, Opening up to OAuth2, Chapter 10, SAML 2 Support, and Chapter 18, Single Sign-On with the Central Authentication Service) requires the use of HTTPS in order for the sample code to work.
Some projects have been configured to run HTTPS; most of the configuration is managed in properties or YAML files.
Now, when you run the sample code on the embedded Tomcat server from Maven or Gradle, you can connect to http://localhost:8080 or https://localhost:8443.
If you do not already have a certificate, you must first generate one.
If you wish, you can skip this step and use the tomcat.keystore file, which contains a certificate that is located in the src/main/resources/keys directory in the book’s sample source.
Enter the following command lines at the command prompt:
keytool -genkey -alias jbcpcalendar -keypass changeit -keyalg...