【问题标题】:How to connect to a Weblogic JMS queue using t3s?如何使用 t3s 连接到 Weblogic JMS 队列?
【发布时间】:2009-09-25 11:53:08
【问题描述】:

我希望独立应用程序中的最后一行能够通过,而不会引发异常:

    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);

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

警告安全 BEA-090542 从本地主机接收的证书链 - 127.0.0.1 不受信任,导致 SSL 握手失败。检查证书链以确定它是否应该被信任。如果应该信任它,则更新客户端信任的 CA 配置以信任签署对等证书链的 CA 证书。如果您要连接到使用演示证书(默认 WLS 服务器行为)的 WLS 服务器,并且希望此客户端信任演示证书,请在此客户端的命令行上指定 -Dweblogic.security.TrustKeyStore=DemoTrust。

所以,我使用以下命令为 ca 创建了一个密钥库:

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

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

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

【问题讨论】:

  • 您是否在管理控制台中设置了队列和连接工厂?
  • 是的,使用 t3 协议一切正常,无需 ssl。使用 t3s,我从来没有一直到 jndi 查找。创建 InitialContext 实例时在 ssl 握手时引发异常。

标签: java ssl jms weblogic


【解决方案1】:

差不多两个月后,我回到了这个问题。找到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");

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-08-22
    • 1970-01-01
    • 2014-03-28
    • 2014-04-17
    • 2011-10-09
    • 2013-05-12
    • 2020-09-13
    • 2011-05-21
    相关资源
    最近更新 更多