【发布时间】:2013-05-20 19:38:28
【问题描述】:
我一直在开发一个 java activemq 客户端软件来连接到一个支持 ssl 的代理,但是通过以下方式以编程方式设置信任库:
// Configure the secure connection factory.
ActiveMQSslConnectionFactory connectionFactory = new ActiveMQSslConnectionFactory(url);
connectionFactory.setTrustStore("/conf/client.ts"); // truststore which includes the certificate of the broaker
connectionFactory.setTrustStorePassword("password");
如here 所示。但是,那抛出一个
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException:PKIX 路径构建失败 错误
根据 QA Resolving javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed Error? 的回复,通过将代理证书添加到我的 java 安装的受信任证书中,我能够成功地将客户端连接到代理。
但是,在这种情况下,我不希望每个使用应用程序的用户都在他们的 java 发行版上导入证书,而是希望客户端应用程序已经携带了代理证书。我怎样才能最好地使用 ActiveMQSslConnectionFactory 类?
【问题讨论】:
标签: java ssl jms ssl-certificate activemq