admin管理员组文章数量:1122846
I'm trying to connect my application with kafka and getting the following error. I'm generating truststore and keystore in the entrypoint.sh following manner.
Truststore:
keytool -keystore "${TRUSTSTORE_JKS_PATH}" -storepass "${KAFKA_TRUSTSTORE_PASSWORD}" -alias CA -importcert -file /tmp/ca.crt -noprompt
keytool -keystore "${TRUSTSTORE_JKS_PATH}" -storepass "${KAFKA_TRUSTSTORE_PASSWORD}" -alias Root -importcert -file /tmp/root.crt -noprompt
openssl pkcs12 -export -in /tmp/user.crt -inkey /tmp/user.key -name "${HOSTNAME}" -password pass:"${KAFKA_KEYSTORE_PASSWORD}" -out "${KEYSTORE_P12_PATH}"
keytool -importkeystore -srckeystore "${KEYSTORE_P12_PATH}" -srcstoretype pkcs12 -srcalias "${HOSTNAME}" -destkeystore "${KEYSTORE_JKS_PATH}" -deststoretype jks -deststorepass "${KAFKA_KEYSTORE_PASSWORD}" -destalias "${HOSTNAME}" -srcstorepass "${KAFKA_KEYSTORE_PASSWORD}"
Props : {default.value.serde=org.apache.kafkamon.serialization.Serdes$StringSerde, ssl.keystore.location=/app/keystore.jks, bootstrap.servers=devserve:9094, key.serializer=class org.apache.kafkamon.serialization.StringSerializer, default.key.serde=org.apache.kafkamon.serialization.Serdes$StringSerde, security.protocol=SSL, ssl.truststore.location=/app/truststore.jks, value.serializer=class com.fasterxml.jackson.databind.JsonSerializer, ssl.keystore.password=password, ssl.truststore.password=password, application.id=configurable-app, ssl.endpoint.identification.algorithm=}
Error:
Caused by: org.apache.kafkamon.errors.SslAuthenticationException: SSL handshake failed
Caused by: javax.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:131)
at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:383)
at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:326)
at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:321)
at
How to resolve this issue?
本文标签: opensslKafka SSL handshake failed in Java applicationStack Overflow
版权声明:本文标题:openssl - Kafka SSL handshake failed in Java application - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736282559a1926679.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论