<atom:feed xmlns:atom="http://www.w3.org/2005/Atom">
    <atom:id/>
    <atom:updated>2012-04-09T10:28:16.773+02:00</atom:updated>
    <atom:title>HowTos Bla</atom:title>
    <atom:author>
        <atom:name>admin</atom:name>
    </atom:author>
    <atom:entry>
        <atom:id>urn:uuid:a1e2479e-78c5-42c2-a832-04d4daf772fd</atom:id>
        <wiki:id xmlns:wiki="http://exist-db.org/xquery/wiki">JettySSL</wiki:id>
        <wiki:editor xmlns:wiki="http://exist-db.org/xquery/wiki">html</wiki:editor>
        <wiki:is-index xmlns:wiki="http://exist-db.org/xquery/wiki">false</wiki:is-index>
        <atom:published>2008-12-03T20:06:25+01:00</atom:published>
        <atom:updated>2016-12-11T18:01:10.329+01:00</atom:updated>
        <atom:author>
            <atom:name>dizzzz</atom:name>
        </atom:author>
        <atom:title>Enable SSL in Jetty</atom:title>
        <atom:content type="xhtml">
            <article xmlns="http://www.w3.org/1999/xhtml">
                <div>
                    <p>
                        <b>Note: this is for eXist-2.2 only! For eXist-3.0 the HTTPS port is enabled by default on port 8443.</b>
                    </p>
                    <p>It is not very difficult to enable HTTPS for exist. Basically the process of enabling SSL in jetty consists of three steps:</p>
                    <ol>
                        <li>Edit the Jetty configuration</li>
                        <li>Create SSL Certficates</li>
                        <li>Read the additional notes</li>
                    </ol>
                    <h2>Edit the Jetty configuration</h2>
                    <ol>
                        <li>Open <code>EXIST_HOME/tools/jetty/etc/jetty.xml</code> in your favourite text editor (jEdit?)</li>
                        <li>Scroll down to line 69, uncomment line 74 - 93 (element "<em>Call</em>")</li>
                    </ol>
                    <div class="ext:code?lang=xml">
    &lt;Call name="addListener"&gt;
        &lt;Arg&gt;
            &lt;New class="org.mortbay.http.SunJsseListener"&gt;
                &lt;Set name="Port"&gt;8443&lt;/Set&gt;
                &lt;Set name="PoolName"&gt;P1&lt;/Set&gt;
                &lt;Set name="MaxIdleTimeMs"&gt;30000&lt;/Set&gt;
                &lt;Set name="lowResources"&gt;30&lt;/Set&gt;
                &lt;Set name="LowResourcePersistTimeMs"&gt;2000&lt;/Set&gt;
                &lt;Set name="Keystore"&gt;
                    &lt;SystemProperty name="jetty.home"
                            default="."/&gt;/etc/demokeystore&lt;/Set&gt;
                &lt;Set name="Password"&gt;secret&lt;/Set&gt;
                &lt;Set name="KeyPassword"&gt;secret&lt;/Set&gt;
                &lt;Set name="HttpHandler"&gt;
                    &lt;New class="org.mortbay.http.handler.MsieSslHandler"&gt;
                        &lt;Set name="UserAgentSubString"&gt;MSIE 5&lt;/Set&gt;
                    &lt;/New&gt;
                &lt;/Set&gt;
            &lt;/New&gt;
        &lt;/Arg&gt;
    &lt;/Call&gt; 
</div>
                    <h2>Create SSL Certficates</h2>
                    <ol>
                        <li>Generate the SSL certificates with <code>./build.sh -f build/scripts/jarsigner.xml jetty-keygen</code>
                        </li>
                    </ol>
                    <div class="ext:code?lang=xml">
    &lt;!-- Generate FAKE CERTIFICATE for SSL --&gt;
    &lt;target name="jetty-keygen" description="Generate keystore for jetty."&gt;
        &lt;genkey alias="jetty" storepass="${keystore.password}"
                keystore="tools/jetty/etc/demokeystore"
                validity="${keystore.validity}"&gt;
            &lt;dname&gt;
                &lt;param name="CN" value="eXist XML database"/&gt;
                &lt;param name="OU" value="Anonymous"/&gt;
                &lt;param name="O" value="exist-db.org"/&gt;
                &lt;param name="C" value="DE"/&gt;
            &lt;/dname&gt;
        &lt;/genkey&gt;
    &lt;/target&gt; 
</div>
                    <h2>Additional notes</h2>
                    <p>Now you are actually ready!</p>
                    <ol>
                        <li>Start the server with <code>bin/startup.sh</code>
                        </li>
                        <li>Point your browser to <a/>
                        </li>
                    </ol>
                    <p>Please note only the http traffic to port 8443 is encrypted. Other ports are still unsecure. Check for the following logging in the console:</p>
                    <div>
05 Dec 2008 22:40:16,713 [main] INFO  (Container.java [start]:74) - Started WebApplicationContext[/exist,eXist XML Database] 
05 Dec 2008 22:40:16,719 [main] INFO  (SocketListener.java [start]:205) - Started SocketListener on 0.0.0.0:8080 
05 Dec 2008 22:40:16,720 [main] INFO  (SunJsseListener.java [createFactory]:185) - jetty.ssl.keystore=/Users/drfoobar/eXist/tools/jetty/etc/demokeystore 
05 Dec 2008 22:40:16,720 [main] INFO  (SunJsseListener.java [createFactory]:189) - jetty.ssl.password=****** 
05 Dec 2008 22:40:16,720 [main] INFO  (SunJsseListener.java [createFactory]:195) - jetty.ssl.keypassword=****** 
05 Dec 2008 22:40:16,720 [main] INFO  (SunJsseListener.java [createFactory]:200) - jetty.ssl.keystore.type=jks 
05 Dec 2008 22:40:16,721 [main] INFO  (SunJsseListener.java [createFactory]:225) - jetty.ssl.keystore.provider.name=[DEFAULT] 
05 Dec 2008 22:40:16,735 [main] INFO  (SunJsseListener.java [createFactory]:248) - SSLServerSocketFactory=com.sun.net.ssl.internal.ssl.SSLServerSocketFactoryImpl@95575f 
05 Dec 2008 22:40:16,945 [main] INFO  (JsseListener.java [newServerSocket]:200) - JsseListener.needClientAuth=false 
05 Dec 2008 22:40:16,946 [main] INFO  (SocketListener.java [start]:205) - Started SocketListener on 0.0.0.0:8443 
05 Dec 2008 22:40:16,946 [main] INFO  (Container.java [start]:74) - Started org.mortbay.jetty.Server@eb41e5 
-----------------------------------------------------
Server has started on port 8080. Configured contexts:
http://localhost:8080/exist
-----------------------------------------------------
05 Dec 2008 22:40:28,891 [P1-9] INFO  (Container.java [start]:74) - Started HttpContext[/,/] 
</div>
                    <p>If you have a 'real' x509 certificate (free at e.g. <a href="https://www.thawte.com/cgi/personal/contents.exe">Thawte</a>) you might consider to convert your x509 certificate using <a href="http://yellowcat1.free.fr/index_ktl.html">KeyTool IUI</a> into a Java KeyStore (jks)</p>
                </div>
                <p/>
            </article>
        </atom:content>
        <atom:link type="blog" href="/db/apps/wiki/data/HowTo"/>
    </atom:entry>
    <atom:entry>
        <atom:id>urn:uuid:d06b9a3b-5eb1-4213-a1ac-2b1bb7d42562</atom:id>
        <wiki:id xmlns:wiki="http://exist-db.org/xquery/wiki">HowTos</wiki:id>
        <wiki:editor xmlns:wiki="http://exist-db.org/xquery/wiki">wiki</wiki:editor>
        <wiki:is-index xmlns:wiki="http://exist-db.org/xquery/wiki">true</wiki:is-index>
        <atom:published>2007-12-01T18:57:22+00:00</atom:published>
        <atom:updated>2012-04-09T10:40:51.166+02:00</atom:updated>
        <atom:author>
            <atom:name>ljo</atom:name>
        </atom:author>
        <atom:title>HowTos</atom:title>
        <atom:content type="xhtml">
            <article xmlns="http://www.w3.org/1999/xhtml">
                <table>
                    <tr>
                        <th> SQL Databases</th>
                        <th>Querying SQL Databases from XQuery (SQLModule)</th>
                        <th/>
                    </tr>
                    <tr>
                        <th> XSLT 2</th>
                        <th>Upgrading eXist for XSLT 2.0 (Saxon)</th>
                        <th/>
                    </tr>
                    <tr>
                        <th> Troubleshooting</th>
                        <th>Some help for common issues</th>
                        <th/>
                    </tr>
                    <tr>
                        <th/>
                        <th>Enabling SSL in Jetty</th>
                        <th/>
                    </tr>
                    <tr>
                        <th> Oxygen</th>
                        <th>Accessing eXist-db 1.3/trunk from the OxygenXML editor</th>
                        <th/>
                    </tr>
                    <tr>
                        <th> XQuery 3</th>
                        <th>Using some XQuery 3 features: switch expression, try/catch expression and group by clause in FLWOR</th>
                        <th/>
                    </tr>
                </table>
            </article>
        </atom:content>
        <atom:link type="blog" href="/db/apps/wiki/data/HowTo"/>
    </atom:entry>
</atom:feed>