Play Framework を始めたばかりの方向けに、サンプルを進めるうえで困ったところを共有する目的で書いています。
Play Framework 2.8.16 にて、run
起動時に、https および http2 でアクセス可能としたときのメモです。
以下、目次
前提
- 独自ドメインを保有している
- ZeroSSL で certificate items (certificate.crt, ca_bundle.crt and private.key) をダウンロード済み
- Eclipse Adoptium Java 11.0.16.1 を利用
方針
- ローカル環境に対して https および http2 でアクセス(ローカル開発環境の https 化 を参考)
- openssl, keytool を使って、certificate items を jks に変換
sbt run -D(options)
で play を実行
結果
できました play-tls-test
補足
sbt run -D(options)
実行時、以下の WARNING がでます。
WARNING: An illegal reflective access operation has occurred WARNING: Please consider reporting this to the maintainers of scala.reflect.package$ WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release
そのため、Java 17 では https でアクセスできないようでした。 play 2.9 では解決するよう?
参考にしたところ
- ローカル開発環境の https 化
- Play Framework + Let's Encrypt で、非 JKS 証明書形式 ( PEM / PKCS ) を使って SSL/TLS で HTTPS してみた話
以上でした。