【问题标题】:Enable / disable allowed cipher suites in Apache Karaf with Pax (including Jetty)使用 Pax(包括 Jetty)在 Apache Karaf 中启用/禁用允许的密码套件
【发布时间】:2015-06-23 22:48:05
【问题描述】:

我正在使用 Apache Karaf 来托管我的 Web 服务。我在启动后使用下面显示的命令通过 Karaf 客户端启用了 SSL 连接,因为我有多个服务器运行相同的代码但具有不同的证书和配置。

当我通过 SSL 连接到我的服务时,我收到关于使用过时加密的警告,并发现 this post 解释了我需要如何更改我的服务器以仅使用现代加密算法。

  1. 我能否使用 Karaf/Pax 设置所需的算法,例如设置下面的 SSL 配置? (首选)
  2. 或者我是否需要按照here 的描述使用 Jetty 和从this pageenable/disable cipher suites 的信息进行自定义信任管理?

这是我目前用来设置 HTTPS 端口的示例代码。

config:edit org.ops4j.pax.web;
config:property-set org.osgi.service.http.enabled false; 
config:property-set org.osgi.service.http.secure.enabled true;
config:property-set org.osgi.service.http.port.secure 9443; 
config:property-set org.ops4j.pax.web.ssl.keystore.type JKS; 
config:property-set org.ops4j.pax.web.ssl.keystore /etc/pki/tls/ks.jks;
config:property-set org.ops4j.pax.web.ssl.password ************;
config:property-set org.ops4j.pax.web.ssl.keypassword *********;
config:property-set org.ops4j.pax.web.ssl.clientauthwanted false;
config:property-set org.ops4j.pax.web.ssl.clientauthneeded false;
config:update;

谢谢!

【问题讨论】:

    标签: java ssl jetty apache-karaf pax-web


    【解决方案1】:

    在org.ops4j.pax.web.cfg中,可以进行如下设置,例如:

    org.ops4j.pax.web.ssl.ciphersuites.included=TLS_DHE_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_128_CBC_SHA
    org.ops4j.pax.web.ssl.ciphersuites.excluded=TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA,TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
    
    org.ops4j.pax.web.ssl.protocols.included=TLSv1.2
    

    您也可以使用 OP 在他的回答中使用的技术:

    config:edit org.ops4j.pax.web;
    config:property-set org.ops4j.pax.web.ssl.protocols.included TLSv1.2
    

    【讨论】:

      【解决方案2】:

      通过正确配置 ssl 连接器的方法,您最终会得到 Jetty 提供的默认 SSL 连接器。现在您想切换到很棒的 TLS。您不需要自定义信任管理,目前无法使用配置参数配置密码套件。请为此在 ops4j 上打开一个新功能请求。

      【讨论】:

      • 感谢您的信息!您对我在此期间应该做什么有什么建议吗?环顾四周,我发现 Apache Felix 支持:org.apache.felix.https.jetty.ciphersuites.excludedorg.apache.felix.https.jetty.ciphersuites.included;但这不是我可以使用的东西吗?
      • 还有一些关于配置 Apache 的虚拟主机文件的信息,但似乎可能是在 Karaf 中生成的?
      • org.apache.felix* 属性用于 http 服务的 felix 实现,与 pax-web 无关,因此不起作用。您可能想尝试将基于 jetty.xml 的配置与基于配置的连接器“合并”。
      • 虚拟主机不同,与“apache虚拟主机”定义文件无关。
      • 仅供参考,属性名称拼写错误。它们应该是: org.ops4j.pax.web.ssl.ciphersuites.included org.ops4j.pax.web.ssl.ciphersuites.excluded 所有可能的配置都在这里:github.com/ops4j/org.ops4j.pax.web/blob/master/pax-web-runtime/…
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-04-20
      • 1970-01-01
      相关资源
      最近更新 更多