在SSL通信期间,在客户端和服务器之间的握手过程中,会报告错误:
Server write IV:
0000: 85 80 28 A4 CA 34 3A 5B A5 C5 7E 71 5A A9 02 1F ..(..4:[...qZ...
HTTP-Dispatcher, READ: GMSSLv1.1 Change Cipher Spec, length = 1
HTTP-Dispatcher, READ: GMSSLv1.1 Handshake, length = 80
HTTP-Dispatcher, fatal error: 80: problem unwrapping net record
java.lang.ArrayIndexOutOfBoundsException: javax.crypto.BadPaddingException: Padding length invalid: 239
%% Invalidated: [Session-1, ECC_SM4_CBC_SM3]
HTTP-Dispatcher, SEND GMSSLv1.1 ALERT: fatal, description = internal_error
HTTP-Dispatcher, WRITE: GMSSLv1.1 Alert, length = 2
HTTP-Dispatcher, called closeInbound()
HTTP-Dispatcher, fatal: engine already closed. Rethrowing javax.net.ssl.SSLException: Inbound closed before receiving peer's close_notify: possible truncation attack?
HTTP-Dispatcher, called closeOutbound()
HTTP-Dispatcher, closeOutboundInternal()
javax.crypto.BadPaddingException: Padding length invalid: 239
有人遇到过这个问题吗?我最初怀疑这是keyStore构造的问题,但我找不到具体的问题。
KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType(), BouncyCastleProvider.PROVIDER_NAME);
keyStore.load(null, null);
keyStore.setKeyEntry("signPrivateKey", signPrivateKey, "".toCharArray(),
new Certificate[]{signX509Certificate});
keyStore.setKeyEntry("encPrivateKey", encPrivateKey, "".toCharArray(),
new Certificate[]{encX509Certificate});
1条答案
按热度按时间kmpatx3s1#
主要是因为KeyStore加载问题