使用 Pax(包括 Jetty)在 Apache Karaf 中启用/禁用允许的密码套件

Enable / disable allowed cipher suites in Apache Karaf with Pax (including Jetty)

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

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

  1. 我是否可以使用 Karaf/Pax 设置所需的算法,例如设置下面的 SSL 配置? (首选)
  2. 或者我是否需要按照描述进行自定义信任管理here with Jetty and information from this page to enable/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;

谢谢!

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

在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