jetty启动https

<Configure id="Server" class="org.eclipse.jetty.server.Server">

  <!-- if NIO is not available, use org.eclipse.jetty.server.ssl.SslSocketConnector -->
  
  <New id="sslContextFactory" class="org.eclipse.jetty.http.ssl.SslContextFactory">
    <Set name="KeyStore">C:/Users/admin/test.keystore</Set>
    <Set name="KeyStorePassword">testtest</Set>
    <Set name="KeyManagerPassword">testtest</Set>
    <Set name="TrustStore">C:/Users/admin/test.keystore</Set>
    <Set name="TrustStorePassword">testtest</Set>
  </New>

  <Call name="addConnector">
    <Arg>
      <New class="org.eclipse.jetty.server.ssl.SslSelectChannelConnector">
        <Arg><Ref id="sslContextFactory" /></Arg>
        <Set name="Port">8443</Set>
        <Set name="maxIdleTime">30000</Set>
        <Set name="Acceptors">2</Set>
        <Set name="AcceptQueueSize">100</Set>
      </New>
    </Arg>
  </Call>
</Configure>

修改jetty-ssl.xml,如上

证书生成参考:http://ln-ydc.iteye.com/blog/1335213

 

posted @ 2016-11-18 20:13  蝼蚁尚不自知  阅读(2824)  评论(0编辑  收藏  举报