Use env vars for TLS files
This commit is contained in:
@@ -62,14 +62,16 @@ impl Application {
|
||||
configuration.application.base_url,
|
||||
redis_store,
|
||||
);
|
||||
let tls_config = if configuration.application.require_tls {
|
||||
let tls_config = if configuration.require_tls {
|
||||
Some(
|
||||
RustlsConfig::from_pem_file(
|
||||
"/home/alphonse/.certs/fullchain.pem",
|
||||
"/home/alphonse/.certs/privkey.pem",
|
||||
std::env::var("APP_TLS_CERT")
|
||||
.expect("Failed to read TLS certificate environment variable"),
|
||||
std::env::var("APP_TLS_KEY")
|
||||
.expect("Feiled to read TLS private key environment variable"),
|
||||
)
|
||||
.await
|
||||
.unwrap(),
|
||||
.expect("Could not create TLS configuration"),
|
||||
)
|
||||
} else {
|
||||
None
|
||||
|
||||
Reference in New Issue
Block a user