Skip to content

Commit

Permalink
Fix accept openssl test
Browse files Browse the repository at this point in the history
  • Loading branch information
SleeplessOne1917 committed May 2, 2024
1 parent 610ba89 commit 027e1d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion actix-tls/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ futures-util = { version = "0.3.17", default-features = false, features = ["sink
itertools = "0.12"
rcgen = "0.12"
rustls-pemfile = "2"
tokio-rustls-025 = { package = "tokio-rustls", version = "0.25" }
tokio-rustls-026 = { package = "tokio-rustls", version = "0.26", features = ["ring"] }
trust-dns-resolver = "0.23"

[[example]]
Expand Down
8 changes: 4 additions & 4 deletions actix-tls/tests/accept-openssl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ fn openssl_acceptor(cert: String, key: String) -> tls_openssl::ssl::SslAcceptor

mod danger {
use rustls_pki_types_1::{CertificateDer, ServerName, UnixTime};
use tokio_rustls_025::rustls;
use tokio_rustls_026::rustls;

/// Disables certificate verification to allow self-signed certs from rcgen.
#[derive(Debug)]
Expand All @@ -63,7 +63,7 @@ mod danger {
_end_entity: &CertificateDer<'_>,
_intermediates: &[CertificateDer<'_>],
_server_name: &ServerName<'_>,
_ocsp_response: &[u8],
_ocsp: &[u8],
_now: UnixTime,
) -> Result<rustls::client::danger::ServerCertVerified, rustls::Error> {
Ok(rustls::client::danger::ServerCertVerified::assertion())
Expand Down Expand Up @@ -137,13 +137,13 @@ async fn accepts_connections() {
let config = rustls_connector(cert, key);
let config = Arc::new(config);

let mut conn = tokio_rustls_025::rustls::ClientConnection::new(
let mut conn = tokio_rustls_026::rustls::ClientConnection::new(
config,
ServerName::try_from("localhost").unwrap(),
)
.unwrap();

let mut stream = tokio_rustls_025::rustls::Stream::new(&mut conn, &mut sock);
let mut stream = tokio_rustls_026::rustls::Stream::new(&mut conn, &mut sock);

stream.flush().expect("TLS handshake failed");
}

0 comments on commit 027e1d4

Please sign in to comment.