title: How do I configure certbot certificates on Tomcat for HTTPS?
body: <p>I've been trying to configure SSL for Tomcat 8.5 server on the school I work to use HTTPS protocol. Since we haven't buy a certificate with a CA, I used certbot to get a free one. I did some configuration and my Tomcat is serving on HTTP but not yet on HTTPS, and there are no errors on the logs. Here is what I did. </p>
  
  <p>-The Tomcat 8.5 is installed on Windows server 2012. It has worked perfectly for 2 years serving applications on regular HTTP.<br>
  -Certbot does not support Windows, therefore, I had to install Ubuntu 16.04 on a VM.
  -I installed certboot successfully on Ubuntu.
  -I used the folowing command to get my certbot certificates:</p>
  
  <pre><code>sudo certbot certonly --preferred-challenges http --manual -d theDomainOfMySchool.com
  </code></pre>
  
  <p>-After succeeding the ACME challenge, I got these 4 .pem files:  cert1.pem, chain1.pem, fullchain1.pem and privkey1.pem. </p>
  
  <p>-All 4 files are clear text in base64 like this extract I’m pasting here:</p>
  
  <pre><code>-----BEGIN CERTIFICATE-----
  MIIFYTCCBEmgAwIBAgISAwyxKh7NQWpNnH6w2enPbOlxMA0GCSqGSIb3DQEBCwUA
  MEoxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MSMwIQYDVQQD
  </code></pre>
  
  <p>-After fighting a while with permissions to copy the 4 files from /etc/letsencrypt/archive, I placed them in the folder of my Tomcat server in Windows.
  -I configured Tomcat with the following nodes on server.xml:</p>
  
  <pre><code>&lt;Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
                 maxThreads="150" SSLEnabled="true" &gt;
          &lt;UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" /&gt;
          &lt;SSLHostConfig&gt;
              &lt;Certificate certificateKeyFile="conf/cert/certbot_gallery/privkey1.pem"
                           certificateFile="conf/cert/certbot_gallery/cert1.pem"
                           certificateChainFile="conf/cert/certbot_gallery/chain1.pem"
                           type="RSA" /&gt;
          &lt;/SSLHostConfig&gt;
      &lt;/Connector&gt;
  
      &lt;Connector port="80" protocol="HTTP/1.1"
             connectionTimeout="20000"
             redirectPort="8443" /&gt;
  
     &lt;Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /&gt;
  </code></pre>
  
  <p>-When I start my Tomcat, there are no errors on the logs. </p>
  
  <p>-The server starts fine and serves on HTTP with no problem.</p>
  
  <p>-When I try to access the applications through HTTPS I get ERR_CONNECTION_RESET on the browser.</p>
  
  <p>What am I doing wrong. Are this kind of certificates not suitable for this Tomcat connector? Am I missing any configuration?</p>
  
  <p>Thank you all.</p>