【问题标题】:How to fix the netty SSL SSLHandshakeException exception?如何修复 netty SSL SSLHandshakeException 异常?
【发布时间】:2022-01-21 07:56:24
【问题描述】:

在我们的项目中,我们使用 Netty 作为 webserver,在 spring boot 项目中。 我们想在项目中启用 HTTPS 和 SSL。 我们通过 keytool 将证书添加到信任库中。

keytool -keystore truststore.jks -import -noprompt -trustcacerts -alias "try" -file "test.cer" -keypass pass -storepass pass

将项目yaml文件中的keypath和keystore信息添加为:

server:
  ssl:
    enabled: true
    key-store: 'truststore.jks'
    key-store-password: "pass"
    key-store-type: JKS
    key-alias: "try"

但是每次我们都会尝试向https://127.0.0.1:8080发送请求

我们得到以下异常:

io.netty.handler.codec.DecoderException: javax.net.ssl.SSLHandshakeException: error:100000ae:SSL routines:OPENSSL_internal:NO_CERTIFICATE_SET
    
Caused by: javax.net.ssl.SSLHandshakeException: error:100000ae:SSL routines:OPENSSL_internal:NO_CERTIFICATE_SET

【问题讨论】:

    标签: spring spring-boot spring-security netty spring-webflux


    【解决方案1】:

    java中的key store有两种

    • 信任库
    • 密钥库

    Truststore: 存储需要添加以与第三方系统通信的所有公钥。 Keystore: 包含私钥。

    我将公钥放在 Keystore 中,这就是问题所在。

    【讨论】:

      猜你喜欢
      • 2017-12-22
      • 2012-05-29
      • 2012-10-19
      • 2019-10-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-24
      • 1970-01-01
      相关资源
      最近更新 更多