Revoking a certificate from ActiveMQ’s truststore doesn’t work.

huangapple go评论54阅读模式
英文:

Revoking a certificate from ActiveMQ's truststore doesn't work

问题

我有一个在Debian Docker容器(Kubernetes)中使用Java 8的Apache ActiveMQ 5.16.3的实例。

它被配置为在/opt/activemq/conf/activemq.xml中使用相互SSL:

        <sslContext>
            <sslContext 
                keyStore="/etc/data/my-bridge-broker.ks"
                keyStorePassword="my-pass" 
                trustStore="/etc/data/broker_to_client.ts"
                trustStorePassword="my-pass"
             />
        </sslContext>
        <!--- ... --->
        <transportConnectors>
            <transportConnector name="ssl" uri="ssl://0.0.0.0:61714?transport.enabledProtocols=TLSv1.2&amp;transport.needClientAuth=true"/>
        </transportConnectors>

相互SSL正常工作,我能够从示例Java客户端连接,使用ActiveMQSslConnectionFactory提供适当的证书在信任库和密钥库以及密码中。

接下来,在代理运行时,我从服务器的信任库中删除了客户端的证书别名:

cd /etc/data
keytool -delete -alias <client-cert-name> -keystore broker_to_client.ts -storepass my-pass

令人惊讶的是,客户端仍然能够连接。我重新启动了服务器,客户端仍然可以连接并将消息发布到队列。有什么想法吗?我以为信任库定义了哪些客户端证书将被允许?

查看文档,他们建议使用证书吊销列表(CRL)或在线证书状态协议(OCSP)。他们没有提到从信任库中删除的选项。这是否意味着ActiveMQ不使用信任库文件?

英文:

I have an instance of Apache ActiveMQ 5.16.3 with Java 8 in a Debian Docker container (Kubernetes).

It's configured to use mutual SSL in /opt/activemq/conf/activemq.xml:

        &lt;sslContext&gt;
            &lt;sslContext 
                keyStore=&quot;/etc/data/my-bridge-broker.ks&quot;
                keyStorePassword=&quot;my-pass&quot; 
                trustStore=&quot;/etc/data/broker_to_client.ts&quot;
                trustStorePassword=&quot;my-pass&quot;
             /&gt;
        &lt;/sslContext&gt;
        &lt;!--- ... ---&gt;
        &lt;transportConnectors&gt;
            &lt;transportConnector name=&quot;ssl&quot; uri=&quot;ssl://0.0.0.0:61714?transport.enabledProtocols=TLSv1.2&amp;amp;transport.needClientAuth=true&quot;/&gt;
        &lt;/transportConnectors&gt;

The mutual SSL works properly, and I am able to connect from a sample Java client, using ActiveMQSslConnectionFactory providing the appropriate certificates in the truststore and keystore and passwords.

Next, while the broker was running I removed the client's certificate by its alias from the server's trust store:

cd /etc/data
keytool -delete -alias &lt;client-cert-name&gt; -keystore broker_to_client.ts -storepass my-pass

Surprisingly, the client is still able to connect. I restarted the server and the client can still connect and post messages on the queues. Any idea why? I thought the truststore defines which client certificates will be allowed?

Looking at the documentation they recommend using Certificate Revocation List (CRL) or Online Certificate Status Protocol (OCSP). They don't mention the option to remove from the truststore. Does this mean ActiveMQ doesn't use the truststore file?

答案1

得分: 1

如果客户端的证书由受信任的机构颁发,那么无论经纪人的信任库中是否包含该证书,客户端的证书仍然会受到信任,因为它来自一个“受信任”的机构。经纪人的信任库仅用于包括来自不受信任的机构或自签名的证书。

英文:

If the client's certificate is issued from a trusted authority then it doesn't matter if the it's in the broker's truststore. The client's certificate will still be trusted because it's from a trusted authority. The broker's truststore is only there to include certificates that come from an untrusted authority or are self-signed.

huangapple
  • 本文由 发表于 2023年2月8日 10:55:07
  • 转载请务必保留本文链接:https://go.coder-hub.com/75380980.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定