emqx/MQTT-Client-Examples

java的demo中的双向认证,客户端证书PKCS#8格式的密钥文件无法加载

Opened this issue · 0 comments

openssl版本:OpenSSL 3.3.1 4 Jun 2024 (Library: OpenSSL 3.3.1 4 Jun 2024)
生成的证书密钥文件格式为:PKCS#8,示例中的只能加载PKCS#1的密钥。
请修改一下示例代码,能够适配两种,或者在生成证书时添加指定版本的参数。

报错信息:
org.bouncycastle.asn1.pkcs.PrivateKeyInfo cannot be cast to org.bouncycastle.openssl.PEMKeyPair