title: Configuration of SSL on Jetty 9 : oeji.SelectorManager:qtp1706748598-22-selector-0: java.lang.NullPointerException
body: <p>I'm trying to configure SSL on Jetty 9.0.4. I'm using Jetty with WebSockets, and Autobahn Android for the Client.</p>
  
  <p>I tried several configurations, following this: 
  <a href="http://www.eclipse.org/jetty/documentation/current/configuring-ssl.html" rel="nofollow noreferrer">http://www.eclipse.org/jetty/documentation/current/configuring-ssl.html</a></p>
  
  <p>And this:
  <a href="https://stackoverflow.com/questions/4008837/configure-ssl-on-jetty">Configure SSL on Jetty</a></p>
  
  <p>At the end I always have this exception</p>
  
  <pre><code>2013-07-07 13:36:11.742:WARN:oeji.SelectorManager:qtp1384613607-13-selector-0: 
  java.lang.NullPointerException
      at org.eclipse.jetty.server.HttpConnection.&lt;init&gt;(HttpConnection.java:96)
      at org.eclipse.jetty.server.HttpConnectionFactory.newConnection(HttpConnectionFactory.java:61)
      at org.eclipse.jetty.server.SslConnectionFactory.newConnection(SslConnectionFactory.java:86)
      at org.eclipse.jetty.server.ServerConnector$ServerConnectorManager.newConnection(ServerConnector.java:401)
      at org.eclipse.jetty.io.SelectorManager$ManagedSelector.createEndPoint(SelectorManager.java:575)
      at org.eclipse.jetty.io.SelectorManager$ManagedSelector.access$500(SelectorManager.java:318)
      at org.eclipse.jetty.io.SelectorManager$ManagedSelector$Accept.run(SelectorManager.java:699)
      at org.eclipse.jetty.io.SelectorManager$ManagedSelector.runChange(SelectorManager.java:407)
      at org.eclipse.jetty.io.SelectorManager$ManagedSelector.runChanges(SelectorManager.java:396)
      at org.eclipse.jetty.io.SelectorManager$ManagedSelector.processChanges(SelectorManager.java:479)
      at org.eclipse.jetty.io.SelectorManager$ManagedSelector.select(SelectorManager.java:440)
      at org.eclipse.jetty.io.SelectorManager$ManagedSelector.run(SelectorManager.java:420)
      at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:596)
      at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:527)
      at java.lang.Thread.run(Thread.java:722)
  </code></pre>
  
  <p>I put everything in jetty.xml. Here is my configuration.</p>
  
  <pre><code>&lt;New id="sslContextFactory" class="org.eclipse.jetty.util.ssl.SslContextFactory"&gt;
      &lt;Set name="KeyStorePath"&gt;
          &lt;Property name="jetty.home" default="." /&gt;/&lt;Property name="jetty.keystore" default="etc/keystore"/&gt;
      &lt;/Set&gt;
      &lt;Set name="KeyStorePassword"&gt;
          &lt;Property name="jetty.keystore.password" default="OBF:password"/&gt;
      &lt;/Set&gt;
      &lt;Set name="KeyManagerPassword"&gt;
          &lt;Property name="jetty.keymanager.password" default="OBF:password"/&gt;
      &lt;/Set&gt;
      &lt;Set name="TrustStorePath"&gt;
          &lt;Property name="jetty.home" default="." /&gt;/&lt;Property name="jetty.truststore" default="etc/keystore"/&gt;
      &lt;/Set&gt;
      &lt;Set name="TrustStorePassword"&gt;
          &lt;Property name="jetty.truststore.password" default="OBF:password"/&gt;
      &lt;/Set&gt;
      &lt;Set name="EndpointIdentificationAlgorithm"/&gt;
      &lt;Set name="ExcludeCipherSuites"&gt;
          &lt;Array type="String"&gt;
              &lt;Item&gt;SSL_RSA_WITH_DES_CBC_SHA&lt;/Item&gt;
              &lt;Item&gt;SSL_DHE_RSA_WITH_DES_CBC_SHA&lt;/Item&gt;
              &lt;Item&gt;SSL_DHE_DSS_WITH_DES_CBC_SHA&lt;/Item&gt;
              &lt;Item&gt;SSL_RSA_EXPORT_WITH_RC4_40_MD5&lt;/Item&gt;
              &lt;Item&gt;SSL_RSA_EXPORT_WITH_DES40_CBC_SHA&lt;/Item&gt;
              &lt;Item&gt;SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA&lt;/Item&gt;
              &lt;Item&gt;SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA&lt;/Item&gt;
          &lt;/Array&gt;
      &lt;/Set&gt;
  &lt;/New&gt;
  &lt;Call id="sslConnector" name="addConnector"&gt;
      &lt;Arg&gt;
          &lt;New class="org.eclipse.jetty.server.ServerConnector"&gt;
              &lt;Arg name="server"&gt;
                  &lt;Ref refid="Server" /&gt;
              &lt;/Arg&gt;
              &lt;Arg name="factories"&gt;
                  &lt;Array type="org.eclipse.jetty.server.ConnectionFactory"&gt;
                      &lt;Item&gt;
                          &lt;New class="org.eclipse.jetty.server.SslConnectionFactory"&gt;
                              &lt;Arg name="next"&gt;http/1.1&lt;/Arg&gt;
                              &lt;Arg name="sslContextFactory"&gt;
                                  &lt;Ref refid="sslContextFactory"/&gt;
                              &lt;/Arg&gt;
                          &lt;/New&gt;
                      &lt;/Item&gt;
                      &lt;Item&gt;
                          &lt;New class="org.eclipse.jetty.server.HttpConnectionFactory"&gt;
                              &lt;Arg name="config"&gt;
                                  &lt;Ref refid="tlsHttpConfig"/&gt;
                              &lt;/Arg&gt;
                          &lt;/New&gt;
                      &lt;/Item&gt;
                  &lt;/Array&gt;
              &lt;/Arg&gt;
              &lt;Set name="host"&gt;
                  &lt;Property name="jetty.host" /&gt;
              &lt;/Set&gt;
              &lt;Set name="port"&gt;
                  &lt;Property name="jetty.tls.port" default="8443" /&gt;
              &lt;/Set&gt;
              &lt;Set name="idleTimeout"&gt;30000&lt;/Set&gt;
          &lt;/New&gt;
      &lt;/Arg&gt;
  &lt;/Call&gt;
  </code></pre>
  
  <p>Then all what I did without SSL should work on jetty ? My servlet and socket ?</p>
  
  <p>Thanks everybody</p>