title: ssl gives ssl_error_rx_record_too_long error on tomcat 6 + jsf 2.0
body: <p>I used this <a href="http://techtracer.com/2007/09/12/setting-up-ssl-on-tomcat-in-3-easy-steps/" rel="nofollow">3 easy steps</a> tutorial to setup SSL on Tomcat 6. I did it step by step. I've even changed the <code>&lt;connector&gt;</code> to be the same as in the tutorial. Unfortunately after restarting Tomcat and running the project i had ssl_error_rx_record_too_long error</p>
  
  <p>here is what I did:</p>
  
  <ol>
  <li>Run command <code>keytool -genkey -alias techtracer -keypass ttadmin -keystore techtracer.bin -storepass ttadmin</code> in java bin folder</li>
  <li>answer questions</li>
  <li>copy the techtracer.bin file into tomcats webapps directory</li>
  <li>modify tomcats conf/server.xml file as follows</li>
  </ol>
  
  <p>`</p>
  
  <pre><code>&lt;Connector port=”8443″
  maxThreads=”150″ minSpareThreads=”25″ maxSpareThreads=”75″
  enableLookups=”true” disableUploadTimeout=”true”
  acceptCount=”100″ debug=”0″ scheme=”https” secure=”true”
  clientAuth=”false” sslProtocol=”TLS”
  keystoreFile=”../webapps/techtracer.bin”
  keystorePass=”ttadmin” /&gt;
  </code></pre>
  
  <p>`
  5.modify web.xml file in jsf app as follows</p>
  
  <p>add this code:</p>
  
  <pre><code>&lt;security-constraint&gt;
  &lt;web-resource-collection&gt;
  &lt;web-resource-name&gt;securedapp&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>in addition typing <a href="https://localhost:8443/" rel="nofollow">https://localhost:8443/</a> in the browser results with outcome "The connection was terminated while the page was loading". I don't know what causes this problem. Please show me the right direction. Thank You in advance</p>
  
  <p><strong>Resolved:</strong></p>
  
  <ol>
  <li>Run command <code>keytool -genkey -alias tomcat -keyalg RSA</code> in java bin folder</li>
  <li>answer questions</li>
  <li>modify tomcats conf/server.xml file as follows</li>
  </ol>
  
  <p>`</p>
  
  <pre><code>&lt;Connector
         protocol="org.apache.coyote.http11.Http11Protocol"
         port="8443" maxThreads="200"
         scheme="https" secure="true" SSLEnabled="true"
         keystoreFile="C:/Users/Szajba/.keystore" keystorePass="changeit"
         clientAuth="false" sslProtocol="TLS"/&gt;
  </code></pre>
  
  <p>`
  5.modify web.xml file in jsf app as follows</p>
  
  <p>add this code:</p>
  
  <pre><code>&lt;security-constraint&gt;
  &lt;web-resource-collection&gt;
  &lt;web-resource-name&gt;securedapp&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>Works fine for me. Remember to change the password</p>