【问题标题】:Jetty SSL configuration Apache karaf码头 SSL 配置 Apache karaf
【发布时间】:2014-08-18 09:21:05
【问题描述】:

我正在尝试将码头配置为在 Apache Karaf OSGI 容器中使用 SSL。 http 有效,但 https 无效。可能是什么问题?

我的配置详情如下:

etc/jetty.xml

<Call name="addConnector">
    <Arg>
        <New class="org.eclipse.jetty.server.nio.SelectChannelConnector">
            <Set name="host">
                <Property name="jetty.host" />
            </Set>
            <Set name="port">
                <Property name="jetty.port" default="8282" />
            </Set>
            <Set name="maxIdleTime">300000</Set>
            <Set name="Acceptors">2</Set>
            <Set name="statsOn">false</Set>
            <Set name="confidentialPort">8443</Set>
            <Set name="lowResourcesConnections">20000</Set>
            <Set name="lowResourcesMaxIdleTime">5000</Set>
        </New>
    </Arg>
</Call>
<Call name="addConnector">
 <Arg>
   <New class="org.eclipse.jetty.server.ssl.SslSelectChannelConnector">
     <Arg>
       <New class="org.eclipse.jetty.http.ssl.SslContextFactory">
         <Set name="KeyStore">/opt/keystore</Set>
    <Set name="KeyStorePassword">password</Set>
    <Set name="KeyManagerPassword">password</Set>
    <Set name="TrustStore">/opt/keystore</Set>
    <Set name="TrustStorePassword">password</Set>
       </New>
     </Arg>
     <Set name="port">8443</Set>
     <Set name="maxIdleTime">30000</Set>
   </New>
 </Arg>

/etc/org.ops4j.pax.web.cfg 文件中的条目

org.ops4j.pax.web.config.file=${karaf.home}/etc/jetty.xml

【问题讨论】:

    标签: ssl jetty apache-karaf jetty-8


    【解决方案1】:

    要启用 SSL,您只需要使用 httpService 配置来启用它。 为此,请编辑 etc/org.ops4j.pax.web.cfg 并添加/更改以下条目。

    org.osgi.service.http.secure.enabled=true
    

    有关如何配置 Pax Web 和 httpService 的更多详细信息,请访问 official dokumentation 或 integration tests

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-06-01
      • 1970-01-01
      • 2016-04-13
      • 2011-05-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-08-04
      相关资源
      最近更新 更多