KafkaTool Offset Explorer:无法使用给定的密码打开密钥库

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

我正在使用 SSL 从 offset explorer 调用远程 kafka 代理,无需 Zookeeper。配置仅需要设置 chroot 路径、引导服务器以及信任库/密钥库位置和密码。由于某种原因,它说密钥库密码无效。

Offset Explorer 表示无法使用给定的密码打开密钥库。

我可以使用已部署的不同应用程序中的密钥库和信任库成功访问代理并查看主题,但是当我从本地计算机生成新的密钥库时,我收到如下所示的密码错误。

我已确认证书和私钥可以通过 KCat CLI 工具访问代理,跳过密钥库/信任库步骤。

此外,当在 CLI 中通过 keytool 命令访问密钥库时,密码按预期工作。

为什么此密码在 OffsetExplorer 中不起作用?

(下面的 bash 脚本创建了密钥库,$1 是我的签名证书的路径,$2 是我的私钥的路径)

# Converts the pem certificate/key to p12 format
# outputs certificate.p12 with the password set by -passout
openssl pkcs12 -export -in $1 \
-inkey $2 -out certificate.p12 \
-passin pass:helloworld -passout pass:helloworld
 
# Create the jks file using the p12 generated above
keytool -importkeystore -srckeystore certificate.p12 -srcstoretype PKCS12 \
-srcstorepass helloworld -deststorepass helloworld \
-destkeypass helloworld -destkeystore $1-client.keystore.jks

apache-kafka openssl keytool
1个回答
0
投票

问题似乎出在 Java 11 上,这就是我的 JAVA_HOME PATH 变量设置的值 https://forums.oracle.com/ords/apexds/post/pkcs12-certificate-created-with-keytool-in-java- 11-不-t-9510。问题似乎是在 Jdk11 上创建的任何密钥库只能由 Jdk11 打开访问。所有其他版本的 java 都相互兼容。

通过更新我的脚本以引用不同 Java 版本的完整文件路径,Offset Explorer 能够使用密钥库,该浏览器看起来运行 Java 版本 1.8

# Converts the pem certificate/key to p12 format
# outputs certificate.p12 with the password set by -passout
openssl pkcs12 -export -in $1 \
-inkey $2 -out certificate.p12 \
-passin pass:helloworld -passout pass:helloworld
 
# Create the jks file using the p12 generated above
C:/Programs/jdk-14.0.2/jdk-14.0.2/bin/keytool -importkeystore -srckeystore certificate.p12 -srcstoretype PKCS12 \
-srcstorepass helloworld -deststorepass helloworld \
-destkeypass helloworld -destkeystore $1-client.keystore.jks

© www.soinside.com 2019 - 2024. All rights reserved.