From 8c1b59ff9e58798c6fb0806fff21aee3ea62b336 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Mon, 22 May 2023 14:18:07 +0100 Subject: [PATCH] update mkcert command --- https-tls/openssl/README.md | 2 +- https-tls/openssl/src/main.rs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/https-tls/openssl/README.md b/https-tls/openssl/README.md index 985726a2..05132f5e 100644 --- a/https-tls/openssl/README.md +++ b/https-tls/openssl/README.md @@ -13,7 +13,7 @@ mkcert -install If you want to generate your own private key/certificate pair, then run: ```sh -mkcert 127.0.0.1 localhost +mkcert -key-file key.pem -cert-file cert.pem 127.0.0.1 localhost ``` A new `key.pem` and `cert.pem` will be saved to the current directory. You will then need to modify `main.rs` where indicated. diff --git a/https-tls/openssl/src/main.rs b/https-tls/openssl/src/main.rs index 9b12d451..d3b604ca 100644 --- a/https-tls/openssl/src/main.rs +++ b/https-tls/openssl/src/main.rs @@ -31,7 +31,9 @@ async fn main() -> io::Result<()> { // set the unencrypted private key // (uncomment if you generate your own key+cert with `mkcert`, and also remove the statement above) - // builder.set_private_key_file("key.pem").unwrap(); + // builder + // .set_private_key_file("key.pem", openssl::ssl::SslFiletype::PEM) + // .unwrap(); // set the certificate chain file location builder.set_certificate_chain_file("cert.pem").unwrap();