我得到的是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/