gpt4 book ai didi

ssl - 无法建立双向 SSL 连接

转载 作者:太空宇宙 更新时间:2023-11-03 13:01:49 25 4
gpt4 key购买 nike

使用纯 Java 客户端我正在尝试连接到其他网络服务器,它可以独立运行,但是当我部署在 weblogic 上并尝试连接它时会出现以下错误。

服务器:weblogic 10.3

SSL 的完整堆栈跟踪:使用下面的 stactrace 很容易听起来握手正在发生,但它再次尝试连接并失败。请告诉我哪里做错了。

我正在使用的代码片段:

文件输入流 fisjks = null;

        FileInputStream fisTrusted = null;

String keyStoreType = "jks";

String passphrase = "password";

String passphraseTrusted = "password";

KeyStore ks = KeyStore.getInstance(keyStoreType);

fisjks = new FileInputStream("C:/CFC/Certs/client.jks");

ks.load(fisjks, passphrase.toCharArray());

KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");

kmf.init(ks, passphrase.toCharArray());

KeyStore ks1 = KeyStore.getInstance(keyStoreType);

fisTrusted = new FileInputStream("C:/CFC/Certs/clientTruststore.jks");

ks1.load(fisTrusted, passphraseTrusted.toCharArray());

TrustManagerFactory tmf = TrustManagerFactory
.getInstance("PKIX");

tmf.init(ks1);

SSLContext sslc = SSLContext.getInstance("SSLv3");

sslc.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);

HttpsTransportInfo https = new HttpsTransportInfo();

https.setKeyManagers(kmf.getKeyManagers());

https.setTrustManagers(tmf.getTrustManagers());

错误堆栈跟踪:

found key for : 1 chain [0] = [ [ Version: V3 Subject: EMAILADDRESS=ravi-kumar.gullapalli@db.com, CN=dbsinlt3767, OU=deutsche bank, O=deutsche bank, L=sg, ST=sg, C=sg Signature Algorithm: SHA1withRSA, OID = 1.2.840.113549.1.1.5

Key: Sun RSA public key, 1024 bits modulus: 144592527724012074845004082487794424487354455673579096476940872358533141438065735825819894128056692571922940458543755331194643176374687100664359963995916933269788855991350833527371185749001888440965012790605437863243747901365797345245355690011955852557580366177837112034836139958497356357064447873318654927713 public exponent: 65537 Validity: [From: Sun Mar 13 17:23:02 SGT 2011, To: Wed Mar 07 17:23:02 SGT 2012] Issuer: EMAILADDRESS=ravi-kumar.gullapalli@db.com, CN=dbsinws3283, OU=deutsche bank, O=deutsche bank, L=sg, ST=sg, C=sg SerialNumber: [ 1001]

Certificate Extensions: 4 [1]: ObjectId: 2.16.840.1.113730.1.13 Criticality=false Extension unknown: DER encoded OCTET string = 0000: 04 1F 16 1D 4F 70 65 6E 53 53 4C 20 47 65 6E 65 ....OpenSSL Gene 0010: 72 61 74 65 64 20 43 65 72 74 69 66 69 63 61 74 rated Certificat 0020: 65 e

[2]: ObjectId: 2.5.29.14 Criticality=false SubjectKeyIdentifier [ KeyIdentifier [ 0000: 75 87 47 BE 09 C0 D9 C7 4F FB 5F 57 1D F7 77 99 u.G.....O._W..w. 0010: CF 12 FB DB
.... ] ]

[3]: ObjectId: 2.5.29.35 Criticality=false AuthorityKeyIdentifier [ KeyIdentifier [ 0000: 96 83 10 39 C4 C0 8F 54 5E 0F 85 A0 9C D4 85 71 ...9...T^......q 0010: FC 55 39 9A
.U9. ]

]

* main, SEND TLSv1 ALERT: fatal, description = certificate_unknown main, WRITE: TLSv1 Alert, length = 2 [Raw write]: length = 7 0000: 15 03 01 00 02 02 2E ....... main, called closeSocket() main, handling exception: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found at weblogic.wsee.jaxrpc.ServiceImpl.throwServiceException(ServiceImpl.java:174) at weblogic.wsee.jaxrpc.ServiceImpl.loadWsdlDefinition(ServiceImpl.java:485) at weblogic.wsee.jaxrpc.ServiceImpl.(ServiceImpl.java:119) at com.db.luup.InvoiceAgentService_Impl.(Unknown Source) at com.db.mobile.test.LuupMobileClientTest1.main(LuupMobileClientTest1.java:78) Caused by: weblogic.wsee.wsdl.WsdlException: Failed to read wsdl file from url due to -- javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found at weblogic.wsee.wsdl.WsdlReader.getDocument(WsdlReader.java:313) at weblogic.wsee.wsdl.WsdlReader.getDocument(WsdlReader.java:305) at weblogic.wsee.wsdl.WsdlSchema.parse(WsdlSchema.java:136) at weblogic.wsee.wsdl.WsdlSchemaImport.parse(WsdlSchemaImport.java:99) at weblogic.wsee.wsdl.WsdlSchema.parse(WsdlSchema.java:116) at weblogic.wsee.wsdl.WsdlSchema.parse(WsdlSchema.java:73) at weblogic.wsee.wsdl.WsdlTypes.parse(WsdlTypes.java:165) at weblogic.wsee.wsdl.WsdlDefinitions.parseChild(WsdlDefinitions.java:520) at weblogic.wsee.wsdl.WsdlExtensible.parse(WsdlExtensible.java:98) at weblogic.wsee.wsdl.WsdlDefinitions.parse(WsdlDefinitions.java:468) at weblogic.wsee.wsdl.WsdlDefinitions.parse(WsdlDefinitions.java:403) at weblogic.wsee.wsdl.WsdlDefinitions.parse(WsdlDefinitions.java:389) at weblogic.wsee.wsdl.WsdlFactory.parse(WsdlFactory.java:79) at weblogic.wsee.wsdl.WsdlFactory.parse(WsdlFactory.java:66) at weblogic.wsee.jaxrpc.ServiceImpl.loadWsdlDefinition(ServiceImpl.java:476) ... 3 more Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1611) at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:187) at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:181) at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1035) at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:124) at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:516) at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:454) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:884) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1112) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1139) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1123) at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:434) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:166) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1049) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:234) at weblogic.wsee.util.is.InputSourceUtil.loadURL(InputSourceUtil.java:100) at weblogic.wsee.util.dom.DOMParser.getWebLogicDocumentImpl(DOMParser.java:118) at weblogic.wsee.util.dom.DOMParser.getDocument(DOMParser.java:65) at weblogic.wsee.wsdl.WsdlReader.getDocument(WsdlReader.java:311) ... 17 more Caused by: sun.security.validator.ValidatorException: No trusted certificate found at sun.security.validator.SimpleValidator.buildTrustedChain(SimpleValidator.java:330) at sun.security.validator.SimpleValidator.engineValidate(SimpleValidator.java:110) at sun.security.validator.Validator.validate(Validator.java:218) at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:126) at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:209) at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:249) at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1014) ... 32 more

最佳答案

服务器不信任客户端证书,反之亦然。

关于ssl - 无法建立双向 SSL 连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6008645/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com