Jetty SSL 配置 Apache karaf [英] Jetty SSL configuration Apache karaf

查看:46
本文介绍了Jetty SSL 配置 Apache karaf的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am trying to configure the jetty to work with SSL in Apache Karaf OSGI container. http works, but https does not work. What could be the problem?

我的配置详情如下:

etc/jetty.xml

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 文件

entry in /etc/org.ops4j.pax.web.cfg file

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

推荐答案

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

To enable SSL, you just need to enable it by using the httpService configuration. For this edit the etc/org.ops4j.pax.web.cfg and add/alter the following entries.

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

有关如何配置 Pax Web 和 httpService 的更多详细信息,请参阅官方文档,或 集成测试

more details on how to configure Pax Web and the httpService can be found at the official dokumentation, or the integration tests

这篇关于Jetty SSL 配置 Apache karaf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆