Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
接受WebLogic 11g中Web服务请求的运行时指定的SSL证书_Ssl_Ssl Certificate_Weblogic11g_Jax Rpc - Fatal编程技术网

接受WebLogic 11g中Web服务请求的运行时指定的SSL证书

接受WebLogic 11g中Web服务请求的运行时指定的SSL证书,ssl,ssl-certificate,weblogic11g,jax-rpc,Ssl,Ssl Certificate,Weblogic11g,Jax Rpc,在我们的应用程序中,我们需要根据存储在数据库中的URL和可信SSL证书调用多个Web服务器设备。这些证书是自签名的,但我们无法将它们添加到WebLogic信任库中。这是双向SSL,但我们的服务器拒绝远程证书 正确的方法是什么 (问题的其余部分描述了我们已经尝试过的内容。) 在WebLogic 10g中,我们通常执行以下操作: WlsSSLAdapter adapter = new WlsSSLAdapter(); try { // setup for clien

在我们的应用程序中,我们需要根据存储在数据库中的URL和可信SSL证书调用多个Web服务器设备。这些证书是自签名的,但我们无法将它们添加到WebLogic信任库中。这是双向SSL,但我们的服务器拒绝远程证书

正确的方法是什么

(问题的其余部分描述了我们已经尝试过的内容。)


在WebLogic 10g中,我们通常执行以下操作:

    WlsSSLAdapter adapter = new WlsSSLAdapter();
    try {
        // setup for client certificate
        adapter.setKeystore(…);
        adapter.setClientCert(…);
        // setup for accepting the remote certificate
        adapter.setTrustManager(new TrustManager() {
            @Override
            public boolean certificateCallback(X509Certificate[] paramArrayOfX509Certificate, int paramInt) {
                return paramArrayOfX509Certificate[0] == expectedCertificate;
            }
        });
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
    ((weblogic.wsee.jaxrpc.StubImpl) servicePort)._setProperty(weblogic.wsee.jaxrpc.WLStub.SSL_ADAPTER, adapter);
然而,在WebLogic 11g中,即使调用了
TrustManager
(我们使用调试器进行了检查),WebLogic似乎也会拒绝证书:

<validationCallback: validateErr = 16> 
<  cert[0] = Serial number: 9232073310112809071929676484517784211
    Issuer:C=US, ST=MyState, L=MyTown, O=MyOrganization, OU=FOR TESTING ONLY, CN=mestoudi2
    Subject:C=US, ST=MyState, L=MyTown, O=MyOrganization, OU=FOR TESTING ONLY, CN=mestoudi2
    Not Valid Before:Tue Nov 01 14:33:31 CET 2011
    Not Valid After:Sun Nov 02 14:33:31 CET 2031
    Signature Algorithm:MD5withRSA
    > 
<weblogic user specified trustmanager validation status 16> 
<Certificate chain received from mestoudi2 - 10.142.0.23 was not trusted causing SSL handshake failure.> 
<Validation error = 16> 
<Certificate chain is untrusted> 
<SSLTrustValidator returns: 16> 
<Trust status (16):  CERT_CHAIN_UNTRUSTED> 
<NEW ALERT with Severity: FATAL, Type: 42
    java.lang.Exception: New alert stack
      at com.certicom.tls.record.alert.Alert.<init>(Unknown Source)
      at com.certicom.tls.record.handshake.HandshakeHandler.fireAlert(Unknown Source)
      at com.certicom.tls.record.handshake.ClientStateReceivedServerHello.handle(Unknown Source)
…
但它也没有被调用——不过它可以用于设置代理。
我们正在使用clientgen Ant任务(
weblogic.wsee.tools.anttasks.ClientGenTask
)生成存根。

当您说“无法将它们添加到weblogic信任库”时,您能否澄清您是否由于某个问题或违反公司政策而无法添加存根,等等?事实上,不将这些证书添加到信任存储的主要原因是我们不希望将这些证书用于web服务调用以外的其他用途。此外,证书可能会在运行时更改,这会将问题转移到修改/重新加载信任存储。最后,我认为这将违反我们客户的政策,但我没有检查。
((weblogic.wsee.jaxrpc.StubImpl) servicePort)._setProperty(TRANSPORT_INFO, transportInfo);