summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2020-05-13 08:53:07 +0300
committerLars Wirzenius <liw@liw.fi>2020-05-13 08:57:51 +0300
commit5d1c903638335cf5397ef34500c1a61f62586bd3 (patch)
tree7ad539c1c908df24e51fcaabc89aee744b9fe163 /src/main.rs
parentd32125b1bfcd360d70b68a2db5942848ac6c6dcf (diff)
downloadewww-5d1c903638335cf5397ef34500c1a61f62586bd3.tar.gz
feat: use TLS unconditionally
Later on, we'll need to support non-TLS as well, for Let's Encrypt, but this'll do for now.
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 35728a9..c6e22ab 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -6,6 +6,8 @@ use warp::Filter;
#[derive(Debug, Deserialize)]
struct Config {
port: u16,
+ tls_key: PathBuf,
+ tls_cert: PathBuf,
}
#[derive(Debug, StructOpt)]
@@ -25,6 +27,9 @@ async fn main() {
eprintln!("starting server: {:?}", config);
warp::serve(hello)
+ .tls()
+ .key_path(config.tls_key)
+ .cert_path(config.tls_cert)
.run(([127, 0, 0, 1], config.port))
.await;
}