Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fafhrd91 committed Jan 8, 2024
1 parent 16a7b89 commit b73e1d6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions examples/tls-server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use std::convert::TryFrom;
use ntex::service::{fn_service, ServiceFactory};
use ntex_h2::{server, ControlMessage, Message, MessageKind, OperationError};
use ntex_http::{header, HeaderMap, StatusCode};
use ntex_tls::openssl::Acceptor;
use openssl::ssl::{AlpnError, SslAcceptor, SslFiletype, SslMethod};
use ntex_tls::openssl::SslAcceptor;
use openssl::ssl::{self, AlpnError, SslFiletype, SslMethod};

#[ntex::main]
async fn main() -> std::io::Result<()> {
Expand All @@ -14,7 +14,7 @@ async fn main() -> std::io::Result<()> {
// create self-signed certificates using:
// openssl req -x509 -nodes -subj '/CN=localhost' -newkey rsa:4096 -keyout examples/key8.pem -out examples/cert.pem -days 365 -keyform PEM
// openssl rsa -in examples/key8.pem -out examples/key.pem
let mut builder = SslAcceptor::mozilla_intermediate(SslMethod::tls()).unwrap();
let mut builder = ssl::SslAcceptor::mozilla_intermediate(SslMethod::tls()).unwrap();
builder
.set_private_key_file("./tests/key.pem", SslFiletype::PEM)
.unwrap();
Expand All @@ -33,7 +33,7 @@ async fn main() -> std::io::Result<()> {

ntex::server::Server::build()
.bind("http", "127.0.0.1:5928", move |_| {
Acceptor::new(acceptor.clone())
SslAcceptor::new(acceptor.clone())
.map_err(|_err| server::ServerError::Service(()))
.and_then(
server::Server::build()
Expand Down
2 changes: 1 addition & 1 deletion tests/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ async fn test_max_concurrent_streams_pool() {
.send(Method::GET, "/".into(), HeaderMap::default(), false)
.await
.unwrap();
sleep(Millis(250)).await;
sleep(Millis(500)).await;
assert!(!client.is_ready());

let client2 = client.clone();
Expand Down

0 comments on commit b73e1d6

Please sign in to comment.