diff --git a/Cargo.toml b/Cargo.toml index 1a3ea5ca9..b013f5443 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -81,7 +81,7 @@ multer = "3" multimap = "0.10" native-tls = "0.2" nix = { version = "0.29", default-features = false } -openssl = "0.10" +openssl = { version = ">=0.10.0, <=0.10.69" } opentelemetry = { version = "0.27", default-features = false } opentelemetry-http = { version = "0.27", default-features = false } opentelemetry-prometheus = { version = "0.27", default-features = false } diff --git a/crates/core/src/conn/openssl/config.rs b/crates/core/src/conn/openssl/config.rs index 8a03386f5..48e49024e 100644 --- a/crates/core/src/conn/openssl/config.rs +++ b/crates/core/src/conn/openssl/config.rs @@ -7,7 +7,7 @@ use std::path::Path; use futures_util::stream::{once, Once, Stream}; use openssl::pkey::PKey; -use openssl::ssl::{SslAcceptor, SslMethod, SslRef}; +use openssl::ssl::{SslAcceptor, SslMethod}; use openssl::x509::X509; use tokio::io::ErrorKind; @@ -163,9 +163,9 @@ impl OpensslConfig { // set ALPN protocols let alpn_protocols = self.alpn_protocols.clone(); - builder.set_alpn_protos(&alpn_protocols)?; + builder.set_alpn_protos(&self.alpn_protocols)?; // set uo ALPN selection routine - as select_next_proto - builder.set_alpn_select_callback(move |_: &mut SslRef, list: &[u8]| { + builder.set_alpn_select_callback(move |_, list| { openssl::ssl::select_next_proto(&alpn_protocols, list).ok_or(openssl::ssl::AlpnError::NOACK) }); if let Some(modifier) = &mut self.builder_modifier { diff --git a/examples/todos/src/main.rs b/examples/todos/src/main.rs index dabae2aef..a2d00050f 100644 --- a/examples/todos/src/main.rs +++ b/examples/todos/src/main.rs @@ -25,21 +25,14 @@ fn index(res: &mut Response) { going to the todo page - " + ", )); } fn route() -> Router { Router::new() - .push( - Router::new() - .get(index) - ) - .push( - Router::new() - .path("todos") - .push(todo_route()) - ) + .push(Router::new().get(index)) + .push(Router::new().path("todos").push(todo_route())) } fn todo_route() -> Router {