mirror of https://github.com/fafhrd91/actix-net
chore: fix rcgen tests
This commit is contained in:
parent
bac46adbe1
commit
2d46a3ff1b
|
@ -21,12 +21,12 @@ use rustls_pki_types_1::ServerName;
|
||||||
use tokio_rustls_026::rustls::RootCertStore;
|
use tokio_rustls_026::rustls::RootCertStore;
|
||||||
|
|
||||||
fn new_cert_and_key() -> (String, String) {
|
fn new_cert_and_key() -> (String, String) {
|
||||||
let cert =
|
let rcgen::CertifiedKey { cert, key_pair } =
|
||||||
rcgen::generate_simple_self_signed(vec!["127.0.0.1".to_owned(), "localhost".to_owned()])
|
rcgen::generate_simple_self_signed(vec!["127.0.0.1".to_owned(), "localhost".to_owned()])
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let key = cert.serialize_private_key_pem();
|
let key = key_pair.serialize_pem();
|
||||||
let cert = cert.serialize_pem().unwrap();
|
let cert = cert.pem();
|
||||||
|
|
||||||
(cert, key)
|
(cert, key)
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,12 +24,12 @@ use rustls_pki_types_1::PrivateKeyDer;
|
||||||
use tls_openssl::ssl::SslVerifyMode;
|
use tls_openssl::ssl::SslVerifyMode;
|
||||||
|
|
||||||
fn new_cert_and_key() -> (String, String) {
|
fn new_cert_and_key() -> (String, String) {
|
||||||
let cert =
|
let rcgen::CertifiedKey { cert, key_pair } =
|
||||||
rcgen::generate_simple_self_signed(vec!["127.0.0.1".to_owned(), "localhost".to_owned()])
|
rcgen::generate_simple_self_signed(vec!["127.0.0.1".to_owned(), "localhost".to_owned()])
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let key = cert.serialize_private_key_pem();
|
let key = key_pair.serialize_pem();
|
||||||
let cert = cert.serialize_pem().unwrap();
|
let cert = cert.pem();
|
||||||
|
|
||||||
(cert, key)
|
(cert, key)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue