Zookeeper作为服务器,配置有keystore,keystore有服务器证书。我的密钥库中的证书链如下所示:
MyIntermediateCert (signed by MyRootCertificate)
MyZookeeperCertificate (signed by MyIntermediateCert)定义的另一个参数是信任库,其中只有根CA MyRootCertificate。
当zk启动时,我在日志中看到外部连接是用TLS配置的,一切都很好,但是当zk的节点试图建立quorum并尝试彼此通信时-我在客户端和服务器之间的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为false,我不需要在节点之间验证主机名。
我的期望是客户端向服务器发送请求(从一个节点到另一个节点的调用),它接收包括服务器证书和中间证书(由CA签名)的证书链,并且在我的信任存储(包括CA)前验证该证书链。
顺便说一下,这个CA是自己生成的。
我错过了什么?
发布于 2021-10-12 05:25:25
我想我找到问题所在了。
问题是我的中间证书在它的AKI扩展中没有包含密钥标识符值,它应该指向根CA。它应该是这样的:

https://stackoverflow.com/questions/69475830
复制相似问题