📅  最后修改于: 2023-12-03 15:32:38.488000             🧑  作者: Mango
If you are a Windows Tomcat developer, you may want to secure your website with SSL certification. Let's Encrypt provides a free and automated way to obtain SSL certificates for your website. In this tutorial, we will show you how to use Let's Encrypt on Windows Tomcat using the Shell/Bash command.
Win-ACME is a command-line tool used to automate the process of obtaining and installing SSL certificates from Let's Encrypt.
Start the Tomcat server by running the following command in the Shell/Bash console:
cd [tomcat_directory]\bin
startup.bat
Open the Shell/Bash console
Navigate to the Win-ACME directory by running the following command:
cd [win-acme_directory]
Run the following command to generate the SSL certificate:
.\wacs.exe --target manual --host [your_domain_name] --validation filesystem --webroot [tomcat_directory]/webapps/ROOT/.well-known/acme-challenge --store pemfiles --pemfilespath [tomcat_directory]\conf\.keystore --certificatestore My
Follow the instructions provided by the tool to complete the SSL certificate generation process
Navigate to the conf directory in your Tomcat installation folder
Open the server.xml file
Uncomment the following lines:
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
keystoreFile="[tomcat_directory]\conf\.keystore"
keystorePass="[your_keystore_password]" />
Make sure to replace [tomcat_directory]
and [your_keystore_password]
with your actual Tomcat directory and keystore password.
Save and close the file
Restart the Tomcat server by running the following command in the Shell/Bash console:
cd [tomcat_directory]\bin
shutdown.bat
cd [tomcat_directory]\bin
startup.bat
Congratulations! You have now successfully set up Let's Encrypt on Windows Tomcat using Shel/Bash command.