Note that there are some explanatory texts on larger screens.

plurals
  1. POSetup SSL (self signed cert) with tomcat
    text
    copied!<p>I am mostly following this page:</p> <p><a href="http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html" rel="noreferrer">http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html</a></p> <p>I used this command to create the keystore</p> <p>keytool -genkey -alias tomcat -keyalg RSA -keystore /etc/tomcat6/keystore</p> <p>and answered the prompts</p> <p>Then i edited my server.xml file and uncommented/edited this line</p> <pre><code>&lt;Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" keystoreFile="/etc/tomcat6/keystore" keystorePass="tomcat" /&gt; </code></pre> <p>then I go to the web.xml file for my project and add this into the file</p> <pre><code> &lt;security-constraint&gt; &lt;web-resource-collection&gt; &lt;web-resource-name&gt;Security&lt;/web-resource-name&gt; &lt;url-pattern&gt;/*&lt;/url-pattern&gt; &lt;/web-resource-collection&gt; &lt;user-data-constraint&gt; &lt;transport-guarantee&gt;CONFIDENTIAL&lt;/transport-guarantee&gt; &lt;/user-data-constraint&gt; &lt;/security-constraint&gt; </code></pre> <p>When I try to run my webapp I am met with this:</p> <pre><code>Unable to connect Firefox can't establish a connection to the server at localhost:8443. * The site could be temporarily unavailable or too busy. Try again in a few moments. * If you are unable to load any pages, check your computer's network connection. </code></pre> <p>If I comment out the lines I've added to my web.xml file, the webapp works fine. My log file in /var/lib/tomcat6/logs says nothing. I can't figure out if this is a problem with my keystore file, my server.xml file or my web.xml file.... Any assistance is appreciated</p> <p>I am using tomcat 6 on ubuntu.</p> <p>Edit: I changed my server.xml to</p> <pre><code>&lt;Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" keystoreFile="/etc/tomcat6/keystore" keystorePass="tomcat" /&gt; </code></pre> <p>incase there was an issue with it being autoconfigured to "APR" as suggested by the tomcat tutorial (not sure if I have that or how to find out if I do). However I am still getting the same error.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload