带有自签名证书错误的 Spring WebFlux Netty SSL [英] Spring WebFlux Netty SSL with Self Signed Certificate error

查看:98
本文介绍了带有自签名证书错误的 Spring WebFlux Netty SSL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用服务器端的自签名证书通过 localhost 中的 https 访问在 Netty 上运行的 Spring Boot 应用程序.

I'm trying to access my Spring Boot application running on Netty via https in localhost, using a self signed certificate on server side.

我的 application.properties 看起来像这样:

My application.properties looks like this:

server.ssl.enabled=true
server.ssl.key-store-type=JKS
server.ssl.key-store=test.jks
server.ssl.key-store-password=password
server.ssl.key-alias=testkey

我通过以下方式生成了密钥库:

I've generated the keystore via:

keytool -genkeypair -alias testkey -keyalg RSA -keysize 4096 -keystore test.jks -validity 36500

我收到以下错误:

io.netty.handler.codec.DecoderException:javax.net.ssl.SSLHandshakeException:收到致命警报:certificate_unknown在 io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:472)在 io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:278)在 io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)在 io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)

io.netty.handler.codec.DecoderException: javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:472) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:278) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)

我尝试将证书导入 JDK 信任库,甚至导入到操作系统,但仍然相同.一位消息人士建议将密钥别名命名为testkey"以使其工作,但这也不起作用.由于在 Google 中没有其他提及此错误,我希望您能提供帮助.

I tried to import the certificate to the JDK truststore, even to the OS but still the same. One source suggested to name the key alias as "testkey" to make it work, which didn't work either. Since there are no other mentions of this error in Google, I'm hoping you could help.

推荐答案

我设法通过使用 https://github.com/FiloSottile/mkcert

这篇关于带有自签名证书错误的 Spring WebFlux Netty SSL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆