【发布时间】:2021-11-27 05:32:21
【问题描述】:
Zookeeper 充当服务器并配置了具有服务器证书的密钥库。我的密钥库中的证书链如下所示:
MyIntermediateCert (signed by MyRootCertificate)
MyZookeeperCertificate (signed by MyIntermediateCert)
定义的另一个参数是truststore,其中我只有root CA MyRootCertificate。
当 zk 启动时,我在日志中看到外部连接配置了 TLS 一切都很好,但是当 zk 的节点尝试建立仲裁并尝试相互通信时 - 我在客户端和服务器之间进行 TLS 握手时收到经典 TLS 异常.
Exception caught
io.netty.handler.codec.DecoderException: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:468)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
ssl.quorum.hostnameVerification 为假,我不需要节点之间的主机名验证。
我的期望是客户端向服务器发送请求(从一个节点到另一个节点的调用),它接收到证书链,其中包括服务器证书和中间证书(由 CA 签名),并且该链在我的信任存储之前得到验证包括 CA。
顺便说一下,这个CA是自己生成的。
我错过了什么?
【问题讨论】:
标签: security ssl apache-zookeeper tls1.2 sslhandshakeexception