java - 如何使用 t3s 连接到 Weblogic JMS 队列?

标签 java ssl jms weblogic

我希望独立应用程序中的这些行中的最后一行在没有抛出异常的情况下通过:

    Properties props = new Properties();
    props.setProperty("java.naming.factory.initial",
                      "weblogic.jndi.WLInitialContextFactory");
    props.setProperty("java.naming.provider.url",
                      "t3s://localhost:9002");
    props.setProperty("java.naming.security.principal",
                      "<username>");
    props.setProperty("java.naming.security.credentials",
                      "<password>");
    Context ctx = new InitialContext(props);

...但是我在异常中得到了这些信息:

Warning Security BEA-090542 Certificate chain received from localhost - 127.0.0.1 was not trusted causing SSL handshake failure. Check the certificate chain to determine if it should be trusted or not. If it should be trusted, then update the client trusted CA configuration to trust the CA certificate that signed the peer certificate chain. If you are connecting to a WLS server that is using demo certificates (the default WLS server behavior), and you want this client to trust demo certificates, then specify -Dweblogic.security.TrustKeyStore=DemoTrust on the command line for this client.

因此,我使用以下命令为 ca 创建了一个 keystore :

keytool -keystore client.jks -importcert -file cacert.pem

...并使用属性 weblogic.security.TrustKeyStore=client.jks 引用它

这仍然不起作用,很可能是因为我没有向 keystore 提供密码。我错过了什么?我怎样才能提供这个密码? (或者,如何在不为其设置密码的情况下创建 keystore ?)

最佳答案

差不多两个月后,我又回到了这个问题。找到this link后,我发现这行得通:

        System.setProperty("weblogic.security.SSL.ignoreHostnameVerification","true");
        System.setProperty("java.protocol.handler.pkgs", "weblogic.net");
        System.setProperty("weblogic.security.TrustKeyStore","CustomTrust");
        System.setProperty("weblogic.security.CustomTrustKeyStoreFileName", "<keystorelocation>");
        System.setProperty("weblogic.security.CustomTrustKeyStorePassPhrase","<keystorepassword>"); 
        System.setProperty("weblogic.security.CustomTrustKeyStoreType","JKS");

我只是使用系统属性让它工作。

关于java - 如何使用 t3s 连接到 Weblogic JMS 队列?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1476871/

相关文章:

java - 使用 JMS 重试机制记录异常情况

用于下载文件或 zip 文件的 Java 代码

java - 线程“main”中的Maven项目异常java.lang.NoClassDefFoundError:org/springframework/core/DefaultParameterNameDiscoverer

unix - 通过 unix 在单元信任库中添加证书

python - pycurl 和 SSL 证书

Java EE 中的 JMS 和 JTA 事务

java - 什么是 PECS(生产者扩展消费者 super )?

java - 寻找一个支持 django 风格的 url 处理的 java web 框架

SSL 证书、godaddy、JBoss AS 7

java - 如何序列化您在 JMS 模板 Convert 和 Send 方法中发送的自定义对象