使用HTTPS/SSL启动Typesafe Play框架
我无法使用HTTPS启动和运行我们的系统 我已经从我们的通配符证书创建了一个密钥文件,并将密钥文件放在我们的使用HTTPS/SSL启动Typesafe Play框架,ssl,https,playframework,configuration,keystore,Ssl,Https,Playframework,Configuration,Keystore,我无法使用HTTPS启动和运行我们的系统 我已经从我们的通配符证书创建了一个密钥文件,并将密钥文件放在我们的/conf目录中: 473 zbeckman:glimpulse-server$ ll conf total 72 drwxr-xr-x 9 zbeckman staff 306 Sep 7 09:26 ./ drwxr-xr-x 22 zbeckman staff 748 Sep 7 09:32 ../ -rwxr-xr-x 1 zbeckman staff 1213 Sep 7 09:
/conf
目录中:
473 zbeckman:glimpulse-server$ ll conf
total 72
drwxr-xr-x 9 zbeckman staff 306 Sep 7 09:26 ./
drwxr-xr-x 22 zbeckman staff 748 Sep 7 09:32 ../
-rwxr-xr-x 1 zbeckman staff 1213 Sep 7 09:26 application.conf*
-rw-r--r-- 1 zbeckman staff 1374 Sep 7 08:49 glimpulse.keystore
-rw-r--r-- 1 zbeckman staff 1439 Aug 9 15:58 logback.xml
-rwxr-xr-x 1 zbeckman staff 5206 Aug 8 15:36 routes*
-rw-r--r-- 1 zbeckman staff 575 Apr 29 18:55 ws.conf
474 zbeckman:glimpulse-server$
根据播放页面中的说明,我已将以下内容添加到我们的/conf/application.conf
文件中:
最后,我使用-Dhttp.port=disabled-Dhttps.port=9000
尝试启动服务器,但它拒绝启动
以下是结果。注意输出的最后一行:
472 zbeckman:glimpulse-server$ ./activator start -Dhttp.port=disabled -Dhttps.port=9000
[info] Loading project definition from /Users/zbeckman/Projects/Glimpulse/Server/project/glimpulse-server/project
[info] Set current project to Glimpulse (in build file:/Users/zbeckman/Projects/Glimpulse/Server/project/glimpulse-server/)
[warn] The start command is deprecated, and will be removed in a future version of Play.
[warn] To run Play in production mode, run 'stage' instead, and then execute the generated start script in target/universal/stage/bin.
[warn] To test your application using production mode, run 'testProd' instead.
[info] Wrote /Users/zbeckman/Projects/Glimpulse/Server/project/glimpulse-server/target/scala-2.11/glimpulse_2.11-1.0-SNAPSHOT.pom
(Starting server. Type Ctrl+D to exit logs, the server will remain in background)
Must provide either an HTTP or HTTPS port
473 zbeckman:glimpulse-server$
就密钥库而言,我使用Javakeytool
根据我们的通配符域证书生成存储:
keytool -import -alias tomcat -keystore glimpulse.keystore -trustcacerts -file star_glimpulse_com.crt
这看起来很顺利,生成的密钥库没有任何错误或警告。只需将其添加到application.conf:
https {
# The HTTPS port of the server.
port = 9001
}
您的应用程序将在端口9001上侦听。您可以尝试如下方式运行它:
/activator“start-Dhttp.port=disabled-Dhttps.port=9000”
可能需要引号来确保参数以正确的方式传递给start命令。您取得了任何进展吗?当涉及到使用HTTPS运行游戏时,我总是遇到类似的困难。如果有人知道答案,他们似乎不会分享。我曾经遇到过一个演示,它确实有效,但似乎有一些关于证书如何创建的巫术,我还没有解码到足以应用于一个不是从演示/示例开始的项目。
https {
# The HTTPS port of the server.
port = 9001
}