【问题标题】:Play framework with SSL certificates from let's encrypt使用 let's encrypt 的 SSL 证书播放框架
【发布时间】:2016-07-28 07:25:26
【问题描述】:

我正在尝试研究如何使用我从 let's 加密获得的证书与我的独立播放应用程序。我关闭了服务器并运行了生成 4 个文件(cert.pem、chain.pem、fullchain.pem、privatekey.pem)的 certbot,但我不知道如何让我的游戏应用程序使用这些文件。

我使用的是 2.5.4 版本的 play framework。

【问题讨论】:

  • 至少在 play 2.4 中,这是有效的:使用属性 -Dhttps.keyStore-Dhttps.keyStorePassword 指定包含私钥的密钥库。 play 2.5 文档建议其他属性:playframework.com/documentation/2.5.x/…

标签: java playframework ssl-certificate lets-encrypt


【解决方案1】:

Play 使用 Java 密钥库来配置 SSL 证书和密钥。

所以你必须这样做:

  1. 将您的 Let's encrypt 证书转换为 PKCS12
  2. 将 PKCS12 转换为密钥库
  3. 将 Play 配置为使用密钥库

1. PKCS12 文件的证书和密钥

openssl pkcs12 -export -in server.crt -inkey server.key \
    -out server.p12 -name [some-alias] \
    -CAfile ca.crt -caname root

2。将 PKCS12 转换为密钥库

keytool -importkeystore \
    -deststorepass [changeit] -destkeypass [changeit] -destkeystore server.keystore \
    -srckeystore server.p12 -srcstoretype PKCS12 -srcstorepass some-password \
    -alias [some-alias]

3.配置 Play 以使用密钥库

/path/to/your/app/app_name_script -Dhttps.port=443 -Dplay.server.https.keyStore.path=[keyStore-location] -Dplay.server.https.keyStore.password=[keyStore-password]

【讨论】:

    猜你喜欢
    • 2021-06-20
    • 2017-12-13
    • 2021-12-22
    • 1970-01-01
    • 1970-01-01
    • 2020-04-25
    • 2022-08-10
    • 1970-01-01
    • 2016-03-10
    相关资源
    最近更新 更多