我知道这是一个常见的错误,这个问题有很多重复的地方。虽然他们是,我还没有找到真正的原因和解决我的问题,所以让我们开始。
我正在使用Kafka,在我的信任库的服务器端,我有4条链。每个链代表一个证书颁发机构。每条链也以捆绑(Interm + Root cert)的形式进口。当然,每个代理都有自己的密钥存储库,并由CA-1签名。
我的客户有CA-3签署的证书。在我客户的信任库中,我可以列出与我的经纪人相同的链。
示例:
(works)
)
在客户端的调试模式中,我可以找到以下内容:
check handshake state: unknown[13]
*** CertificateRequest
Cert Types: RSA, DSS, ECDSA
Supported Signature Algorithms: SHA512withECDSA, SHA512withRSA, SHA384withECDSA, SHA384withRSA, SHA256withECDSA, SHA256withRSA, SHA256withDSA, SHA224withECDSA, SHA224withRSA, SHA224withDSA, SHA1withECDSA, SHA1withRSA, SHA1withDSA
Cert Authorities:
<CN=CA-1>
<CN=CA-2>
<CN=CA-3>
.
.
.
*** ServerHelloDone
[read] MD5 and SHA1 hashes: len = 4
0000: 0E 00 00 00 ....
Warning: no suitable certificate found - continuing without client authentication
*** Certificate chain
<Empty>
***
.
.
.
kafka-producer-network-thread | console-producer, READ: TLSv1.2 Handshake, length = 3018
check handshake state: server_hello[2]
kafka-producer-network-thread | console-producer, fatal error: 10: Handshake message sequence violation, 2
javax.net.ssl.SSLProtocolException: Handshake message sequence violation, 2
%% Invalidated: [Session-4, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384]
kafka-producer-network-thread | console-producer, SEND TLSv1.2 ALERT: fatal, description = unexpected_message
Padded plaintext before ENCRYPTION: len = 80现在我不明白的是。应用程序能够找到代理的可信证书(最初我不想放日志),能够在CertificateRequest中找到所有可用的CA,但仍然无法握手。
可以肯定的是,我如何获得失败客户端的Interm + Root证书的方式是下载中间证书,并从Interm中提取根证书。创建了一个包,其中interm是第一位的,根是第二位的,而那个包是我在信任库和密钥库中放在一个别名下面的。
我知道这很可能是服务器信任错误,但我不知道如何纠正这个错误,因为证书确实存在,而且我所做的那些证书包的导入与其他正在工作的证书包的导入方式相同。
如果我做错了什么,请纠正我,甚至更好,如果我做错了什么。我是SSL nod,我想学点东西。谢谢!
发布于 2020-06-04 07:09:55
在我的案例中,我认为,在很多情况下,堆叠的问题是:
中没有privKeyEntry
所以如果我这么做:
$ keytool -list -keystore client.keystore.jks 我会发现这个:
primaryca, Jul 26, 2014, trustedCertEntry,
Certificate fingerprint (SHA1): <snip>
client, Jul 26, 2014, trustedCertEntry,
Certificate fingerprint (SHA1): <snip>因此,如您所见,密钥存储库中没有用于客户端证书的PrivateKeyEntry。
所以我从零开始。
# Creating client keystore
$ openssl pkcs12 -export -in client_certificate.crt -inkey client_certificate.key -certfile client_certificate.crt -out client.p12
$ keytool -importkeystore -srckeystore client.p12 -srcstoretype pkcs12 -destkeystore client.keystore.jks -deststoretype JKS
# add bundle (interm + root)
$ keytool -keystore client.keystore.jks -alias CArootbundle -import -file bundle.pem现在,在清单keystore之后:
CArootbundle, Jul 26, 2014, trustedCertEntry,
Certificate fingerprint (SHA1): <snip>
1, Jul 26, 2014, PrivateKeyEntry,
Certificate fingerprint (SHA1): <snip>在我用新创建的keystore启动应用程序之后,每件事都开始工作了:)
希望我帮了别人!
干杯
https://stackoverflow.com/questions/62179874
复制相似问题