Apache ActiveMQ Artemis 2.18 服务器不使用证书重新加载更新的密钥库

Apache ActiveMQ Artemis 2.18 server does not reload the updated keystore with certificates

Apache ActiveMQ Artemis 2.18 不会使用证书重新加载更新的密钥库。以前我们使用 2.17,它工作正常。但是在升级到 2.18 之后,Artemis 实例继续使用启动时提供的证书来处理请求。 密钥库文件每小时更改一次。

客户端的异常是:

Caused by: java.security.cert.CertificateExpiredException: NotAfter: Tue Sep 07 04:10:33 UTC 2021
    at java.base/sun.security.x509.CertificateValidity.valid(CertificateValidity.java:277)
    at java.base/sun.security.x509.X509CertImpl.checkValidity(X509CertImpl.java:683)
    at java.base/sun.security.provider.certpath.BasicChecker.verifyValidity(BasicChecker.java:190)

服务器端的异常是:

2021-09-06 09:30:41,315 WARN  [org.apache.activemq.artemis.core.server] AMQ222208: SSL handshake failed for client from /x.x.x.x:x: javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown.

在 Artemis 服务器重新启动后,新的证书被拾取,Artemis 实例再为请求服务一小时,直到证书过期。

我想知道是否必须应用其他配置。或者如果有一种方法可以在不重启 Artemis 服务器的情况下重新加载密钥库。

由于 ARTEMIS-3117,此行为已更改。以前 javax.net.ssl.SSLContext 的实例是为 每个 连接创建的。这将隐式地为任何新连接获取对密钥库和信任库的任何更改。然而,这是相当低效的,因此不能很好地扩展大量连接。行为已更改,因此只为每个接受器创建一个 javax.net.ssl.SSLContext。但是,您仍然可以在磁盘上更新您的密钥库和信任库,并在不重启的情况下更新代理。只需在接受器上使用 reload 管理操作。这可以通过 JMX、Web 控制台、Jolokia 等获得。

这是一个示例 curl 您可以与 Jolokia 一起使用的命令:

curl --user admin:admin --header "Content-Type: application/json" --request POST --data '{"type":"exec", "mbean":"org.apache.activemq.artemis:broker=\"0.0.0.0\",component=acceptors,name=\"artemis\"", "operation":"reload"}' http://localhost:8161/console/jolokia/exec

当然,您需要根据您的环境调整用户名和密码以及代理和接受方名称。