将第二个.p12导入密钥库后的握手失败和UNKNOWN_CA

问题描述 投票:1回答:1

我通过以下方式将.p12证书添加到了密钥库(到目前为止没有证书)

keytool -importkeystore -noprompt -v -srckeystore FIRSTCert.p12  -srcstoretype PKCS12 -srcstorepass mySrcPassword -destkeystore keyStore.p12 -deststoretype PKCS12 -deststorepass myDestPassword -destkeypass myDestPassword

[我在SOAP UI中将keyStore.p12与密码myDestPassword一起使用,并且一切正常

现在我用(相同的参数)在现有的KeyStore中导入了第二个.p12:

 keytool -importkeystore -noprompt -v -srckeystore SECONDCert.p12  -srcstoretype PKCS12 -srcstorepass 12345 -destkeystore keyStore.p12 -deststoretype PKCS12 -deststorepass myDestPassword -destkeypass myDestPassword

导入有效,但是在尝试使用更新的keyStore.p12进行SOAP调用后(我得到了与以前一样的wsdl和adress,我得到了

javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure

有人知道为什么吗?

UPDATE:

我还试图在Java应用程序中使用此密钥库。行为是相同的。我添加了第一个证书->可以。我添加第二个证书,但出现错误,但是现在,我的错误是:

Exception in thread "main" java.lang.Exception:  myService.uploadParameters call FAILED with: com.sun.xml.internal.ws.client.ClientTransportException: HTTP-Transportfehler: javax.net.ssl.SSLHandshakeException: Received fatal alert: unknown_ca

UPDATE2这里是我的密钥库的内容

C:\>keytool -list -keystore KeyStore.p12 -storetype PKCS12
Keystore-Kennwort eingeben:

Keystore-Typ: PKCS12
Keystore-Provider: SunJSSE

Keystore enthält 2 Einträge

muster max (btt/beat2), 23.03.2020, PrivateKeyEntry,
Zertifikat-Fingerprint (SHA1): 03:A0:3C:0F:4A:91:1A:40:2D:C3:EC:A0:23:D5:E6:44:C5:29:34:DC
client_cert_muster, 23.03.2020, PrivateKeyEntry,
Zertifikat-Fingerprint (SHA1): 06:13:A2:8A:84:E8:F9:74:50:E8:BA:D3:79:9F:FB:5F:CB:09:1E:D0
java soap ssl-certificate soapui keytool
1个回答
0
投票
我认为问题是,您试图将两个

keypairs

放在同一.p12中,并且客户端通常只需要密钥对的公共部分,编码为X509证书。 .p12中的PrivateKeyEntry条目多时,似乎对如何处理感到困惑。
© www.soinside.com 2019 - 2024. All rights reserved.