Enabling TLS support in Tomcat
Configuring TLS for your installation may vary slightly depending on your preferred criteria.
It is recommended that you review and follow the steps provided by Apache for completing the process. Detailed instructions regarding the process can be found at: http://tomcat.apache.org/tomcat-8.0-doc/ssl-howto.html
The steps below are used to create a self-signed certificate for use with your service. Many applications and browsers will warn any user accessing your service that the site may not be secure if you deploy a self-signed certificate. For best results receiving a valid signed certificate from a Certificate Authority is recommended.
📘 Instructions
To create a self-signed certificate for use with your PrinterOn service:
Create the certificate:
On the command line, go to <JRE_Install_Dir>\bin
Run the following command:
- CODE
keytool -genkey -alias tomcat -keyalg RSA
Your keystore will be stored in the home directory of the user under which you ran the command.
Configure the certificate:
Create a password and follow the prompts that follow. The information you enter here is displayed to users who access a secure page in your application. Make sure it matches what users would expect to see.
Important! Your Private Key and Keystore passwords should be the same.
Configure Tomcat:
In a text editor, open C:\Program Files (x86)\PrinterOn Corporation\Apache Tomcat\Conf\server.xml.
Locate the following entry:
- CODE
<!-- Define a SSL HTTP/1.1 Connector on port 443 <Connector port="443" protocol="com.printeron.tomcat.http11.Http11NioProtocol" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" clientAuth="false" sslEnabledProtocols="TLSv1.1,TLSv1.2" keystoreFile="${pon.data.root}\KeyStore\keystore" keystorePass="rz6KZSpMD7fy7Co6UfIBmw%3D%3D" />
Remove the comment fields surrounding the Connector port and edit the highlighted code below for your preferred implementation:
SSL using JSSE:
- CODE
<Connector port=“443” protocol=“org.apache.coyote.http11.Http11NioProtocol” SSLEnabled=“true” maxThreads=“150” scheme=“https” secure=“true” clientAuth=“false” sslEnabledProtocols="TLSv1.1,TLSv1.2" keystoreFile=“C:\Path\to\keystore\.keystore” keystorePass=“keystore password” />
SSL using APR:
- CODE
<Connector port=“443” protocol=“org.apache.coyote.http11.Http11AprProtocol” SSLEnabled=“true” maxThreads=“150” scheme=“https” secure=“true” clientAuth=“optional” sslEnabledProtocols="TLSv1.1,TLSv1.2" SSLCertificateFile="C:\Path\to\certificate\server.crt" SSLCertificateKeyFile=" C:\Path\to\certificateKey\server.pem" SSLPassword=”changeit” />
Save the file.