1
0
mirror of https://github.com/actix/actix-website synced 2025-06-27 15:39:02 +02:00

Updates http2 chapter after testing.

This commit is contained in:
Cameron Dershem
2019-06-18 17:17:43 -04:00
parent 1e8cdcd324
commit e20f6d9d56
4 changed files with 7 additions and 3 deletions

View File

@ -24,7 +24,7 @@ exclude = [
"middleware",
"static-files",
"websockets",
"http20",
"http2",
"databases",
"og_databases",
"sentry",

View File

@ -1,5 +1,5 @@
[package]
name = "http20"
name = "http2"
version = "0.1.0"
edition = "2018"

View File

@ -8,6 +8,8 @@ fn index(_req: HttpRequest) -> impl Responder {
fn main() {
// load ssl keys
// to create a self-signed temporary cert for testing:
// `openssl req -x509 -newkey rsa:4096 -nodes -keyout key.pem -out cert.pem -days 365 -subj '/CN=localhost'`
let mut builder = SslAcceptor::mozilla_intermediate(SslMethod::tls()).unwrap();
builder
.set_private_key_file("key.pem", SslFiletype::PEM)
@ -16,6 +18,8 @@ fn main() {
HttpServer::new(|| App::new().route("/", web::get().to(index)))
.bind_ssl("127.0.0.1:8088", builder)
.unwrap()
.run()
.unwrap();
}
// </main>