Reputation: 1933
I have a Play server configured with SSL. The SSL portion of application.conf
is:
play.server.https {
port = 443
keyStore {
path = "/pathToKeystore"
type = "JKS"
password = "passwordHere"
}
}
Because I'm using Let's Encrypt, my keystore contains a key that expires in 3 months. Before that happens, I need to create a new keystore (with extended expiration) and overwrite the previous one. However, the server appears to read the new file only after it has been restarted. This can cause downtime for the end user.
Is there a way to configure the server to reload the keystore file without restarting?
Upvotes: 1
Views: 83
Reputation: 4729
How about to read file before starting your server. To do it you need to add it as environment variable and pass it to play server during start
play.server.https {
port = 443
keyStore {
path = ${PATH_TO_KEYSTORE}
type = "JKS"
password = ${PASSWORD_HERE}
}
}
And pass it to play like:
sbt run -DPATH_TO_KEYSTORE=actual_path -DPASSWORD_HERE=actual password
I'm not sure that it will behave like observable, so you might need to write script that will run once in three months.
Upvotes: 2