LoginSignup
2
2

More than 5 years have passed since last update.

DropwizardのSSL対応

Posted at

SSLを有効にする場合はyamlファイルに設定を書いてあげればOK。
keystoreファイルはdropwizard-exampleから拝借。

Dropwizardのバージョンは0.6.2。

SSLを有効にする設定

User ManualにはSSLに関する設定しか書いていないけどhttp.connectorTypeも変更する必要がある。
http.connectorTypeは「blocking」、「nonblocking」、「legacy」、「legacy+ssl」、「nonblocking+ssl」の5種類を選択できて、そのうちSSLが有効になるのは「legacy+ssl」、「nonblocking+ssl」の2種類。
その他の3種類を選択するとSSLは使えないっぽい。

下のyamlファイルはGetting StartedのHello WorldにSSLの設定を追加したもの。

hello-world-ssl.yml
template: Hello, %s!
defaultName: Stranger

http:
  connectorType: nonblocking+ssl

  ssl:
    keyStore: ./setting/example.keystore
    keyStorePassword: example

    # optional, JKS is default. JCEKS is another likely candidate.
    keyStoreType: JKS
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2