如何在Play框架上配置SSL证书?

3
根据https://www.playframework.com/documentation/2.5.x/ConfiguringHttps的描述,我生成了X.509证书。但是,我无法配置play以使用此作为ssl证书。请问是否有人能够提供实际的过程,以指定ssl证书并在play中使用此证书来实现https。
注意: 我仅将play用作服务器,react页面作为客户端。因此,请帮助我找出如何在此类场景下配置ssl证书的方法。
谢谢!
1个回答

4
我找到了解决我的问题的方法。

我从https://www.playframework.com/documentation/2.5.x/ConfiguringHttps创建了keyStore.jks。然后,我只需要在application.conf文件中添加以下内容:

Application.conf

play.crypto.secret="changethissosomethingsecret"
play.server.https.keyStore.path = "Path to your .jks file"
play.server.https.keyStore.type = "JKS"
play.server.https.keyStore.password = "yourKeyStorePassword"

那么在开发模式下启动应用程序,我只需要执行以下命令:sbt "start -Dhttps.port=9443"


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接