gpt4 book ai didi

spring-boot - 如何配置 Spring Boot 2 WebFlux 以使用 SSL?

转载 作者:太空宇宙 更新时间:2023-11-03 13:14:28 32 4
gpt4 key购买 nike

我得到的是javax.net.ssl.SSLHandshakeException: no cipher suites in common .

这是重现该行为的方法:

  • 转到http://start.spring.io并添加“Reactive Web”作为 Spring 2.0.1 的依赖
  • 解压存档
  • 运行keytool -genkeypair -keystore demo/src/main/resources/keystore.jks
    • 选择密码
    • 回车只要[Unknown]是默认值,输入Yes当被问到是否 CN=Unknown, OU=Unknown, ...是正确的。
    • 对 key 使用与 keystore 相同的密码
  • 将以下内容添加到 application.properties

    server.ssl.key-store=classpath:keystore.jks
    server.ssl.key-store-password=<my-secure-pwd>
  • 构建并运行应用程序

  • 运行curl https://localhost:8080

这是我第一次将 SSL 添加到 Spring Boot 应用程序,我认为一定有问题 - 但我不知道是什么。也许你们中的任何人都可以提供一些帮助?谢谢!

最佳答案

好的,事实证明您需要将 key 算法设置为 RSA 才能完成这项工作。

keytool -genkeypair -keyalg RSA -keystore src/main/resources/keystore.jks

关于spring-boot - 如何配置 Spring Boot 2 WebFlux 以使用 SSL?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50235957/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com