mirror of
https://github.com/actix/actix-web.git
synced 2024-11-25 11:01:14 +00:00
chore: update rcgen to 0.13
This commit is contained in:
parent
18e02b83d5
commit
e8262da138
12 changed files with 48 additions and 33 deletions
|
@ -135,7 +135,7 @@ env_logger = "0.11"
|
||||||
futures-util = { version = "0.3.17", default-features = false, features = ["alloc"] }
|
futures-util = { version = "0.3.17", default-features = false, features = ["alloc"] }
|
||||||
memchr = "2.4"
|
memchr = "2.4"
|
||||||
once_cell = "1.9"
|
once_cell = "1.9"
|
||||||
rcgen = "0.12"
|
rcgen = "0.13"
|
||||||
regex = "1.3"
|
regex = "1.3"
|
||||||
rustversion = "1"
|
rustversion = "1"
|
||||||
rustls-pemfile = "2"
|
rustls-pemfile = "2"
|
||||||
|
|
|
@ -43,9 +43,10 @@ async fn main() -> io::Result<()> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn rustls_config() -> rustls::ServerConfig {
|
fn rustls_config() -> rustls::ServerConfig {
|
||||||
let cert = rcgen::generate_simple_self_signed(vec!["localhost".to_owned()]).unwrap();
|
let rcgen::CertifiedKey { cert, key_pair } =
|
||||||
let cert_file = cert.serialize_pem().unwrap();
|
rcgen::generate_simple_self_signed(["localhost".to_owned()]).unwrap();
|
||||||
let key_file = cert.serialize_private_key_pem();
|
let cert_file = cert.pem();
|
||||||
|
let key_file = key_pair.serialize_pem();
|
||||||
|
|
||||||
let cert_file = &mut io::BufReader::new(cert_file.as_bytes());
|
let cert_file = &mut io::BufReader::new(cert_file.as_bytes());
|
||||||
let key_file = &mut io::BufReader::new(key_file.as_bytes());
|
let key_file = &mut io::BufReader::new(key_file.as_bytes());
|
||||||
|
|
|
@ -87,9 +87,10 @@ fn tls_config() -> rustls::ServerConfig {
|
||||||
|
|
||||||
use rustls_pemfile::{certs, pkcs8_private_keys};
|
use rustls_pemfile::{certs, pkcs8_private_keys};
|
||||||
|
|
||||||
let cert = rcgen::generate_simple_self_signed(vec!["localhost".to_owned()]).unwrap();
|
let rcgen::CertifiedKey { cert, key_pair } =
|
||||||
let cert_file = cert.serialize_pem().unwrap();
|
rcgen::generate_simple_self_signed(["localhost".to_owned()]).unwrap();
|
||||||
let key_file = cert.serialize_private_key_pem();
|
let cert_file = cert.pem();
|
||||||
|
let key_file = key_pair.serialize_pem();
|
||||||
|
|
||||||
let cert_file = &mut BufReader::new(cert_file.as_bytes());
|
let cert_file = &mut BufReader::new(cert_file.as_bytes());
|
||||||
let key_file = &mut BufReader::new(key_file.as_bytes());
|
let key_file = &mut BufReader::new(key_file.as_bytes());
|
||||||
|
|
|
@ -42,9 +42,11 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
fn tls_config() -> SslAcceptor {
|
fn tls_config() -> SslAcceptor {
|
||||||
let cert = rcgen::generate_simple_self_signed(vec!["localhost".to_owned()]).unwrap();
|
let rcgen::CertifiedKey { cert, key_pair } =
|
||||||
let cert_file = cert.serialize_pem().unwrap();
|
rcgen::generate_simple_self_signed(["localhost".to_owned()]).unwrap();
|
||||||
let key_file = cert.serialize_private_key_pem();
|
let cert_file = cert.pem();
|
||||||
|
let key_file = key_pair.serialize_pem();
|
||||||
|
|
||||||
let cert = X509::from_pem(cert_file.as_bytes()).unwrap();
|
let cert = X509::from_pem(cert_file.as_bytes()).unwrap();
|
||||||
let key = PKey::private_key_from_pem(key_file.as_bytes()).unwrap();
|
let key = PKey::private_key_from_pem(key_file.as_bytes()).unwrap();
|
||||||
|
|
||||||
|
|
|
@ -52,9 +52,10 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
fn tls_config() -> RustlsServerConfig {
|
fn tls_config() -> RustlsServerConfig {
|
||||||
let cert = rcgen::generate_simple_self_signed(vec!["localhost".to_owned()]).unwrap();
|
let rcgen::CertifiedKey { cert, key_pair } =
|
||||||
let cert_file = cert.serialize_pem().unwrap();
|
rcgen::generate_simple_self_signed(["localhost".to_owned()]).unwrap();
|
||||||
let key_file = cert.serialize_private_key_pem();
|
let cert_file = cert.pem();
|
||||||
|
let key_file = key_pair.serialize_pem();
|
||||||
|
|
||||||
let cert_file = &mut BufReader::new(cert_file.as_bytes());
|
let cert_file = &mut BufReader::new(cert_file.as_bytes());
|
||||||
let key_file = &mut BufReader::new(key_file.as_bytes());
|
let key_file = &mut BufReader::new(key_file.as_bytes());
|
||||||
|
|
|
@ -135,7 +135,7 @@ env_logger = "0.11"
|
||||||
flate2 = "1.0.13"
|
flate2 = "1.0.13"
|
||||||
futures-util = { version = "0.3.17", default-features = false, features = ["std"] }
|
futures-util = { version = "0.3.17", default-features = false, features = ["std"] }
|
||||||
rand = "0.8"
|
rand = "0.8"
|
||||||
rcgen = "0.12"
|
rcgen = "0.13"
|
||||||
rustls-pemfile = "2"
|
rustls-pemfile = "2"
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
static_assertions = "1"
|
static_assertions = "1"
|
||||||
|
|
|
@ -64,9 +64,11 @@ fn ssl_acceptor() -> openssl::ssl::SslAcceptorBuilder {
|
||||||
x509::X509,
|
x509::X509,
|
||||||
};
|
};
|
||||||
|
|
||||||
let cert = rcgen::generate_simple_self_signed(vec!["localhost".to_owned()]).unwrap();
|
let rcgen::CertifiedKey { cert, key_pair } =
|
||||||
let cert_file = cert.serialize_pem().unwrap();
|
rcgen::generate_simple_self_signed(["localhost".to_owned()]).unwrap();
|
||||||
let key_file = cert.serialize_private_key_pem();
|
let cert_file = cert.pem();
|
||||||
|
let key_file = key_pair.serialize_pem();
|
||||||
|
|
||||||
let cert = X509::from_pem(cert_file.as_bytes()).unwrap();
|
let cert = X509::from_pem(cert_file.as_bytes()).unwrap();
|
||||||
let key = PKey::private_key_from_pem(key_file.as_bytes()).unwrap();
|
let key = PKey::private_key_from_pem(key_file.as_bytes()).unwrap();
|
||||||
|
|
||||||
|
|
|
@ -34,9 +34,11 @@ const STR: &str = const_str::repeat!(S, 100);
|
||||||
|
|
||||||
#[cfg(feature = "openssl")]
|
#[cfg(feature = "openssl")]
|
||||||
fn openssl_config() -> SslAcceptor {
|
fn openssl_config() -> SslAcceptor {
|
||||||
let cert = rcgen::generate_simple_self_signed(vec!["localhost".to_owned()]).unwrap();
|
let rcgen::CertifiedKey { cert, key_pair } =
|
||||||
let cert_file = cert.serialize_pem().unwrap();
|
rcgen::generate_simple_self_signed(["localhost".to_owned()]).unwrap();
|
||||||
let key_file = cert.serialize_private_key_pem();
|
let cert_file = cert.pem();
|
||||||
|
let key_file = key_pair.serialize_pem();
|
||||||
|
|
||||||
let cert = X509::from_pem(cert_file.as_bytes()).unwrap();
|
let cert = X509::from_pem(cert_file.as_bytes()).unwrap();
|
||||||
let key = PKey::private_key_from_pem(key_file.as_bytes()).unwrap();
|
let key = PKey::private_key_from_pem(key_file.as_bytes()).unwrap();
|
||||||
|
|
||||||
|
@ -714,9 +716,10 @@ mod plus_rustls {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
fn tls_config() -> RustlsServerConfig {
|
fn tls_config() -> RustlsServerConfig {
|
||||||
let cert = rcgen::generate_simple_self_signed(vec!["localhost".to_owned()]).unwrap();
|
let rcgen::CertifiedKey { cert, key_pair } =
|
||||||
let cert_file = cert.serialize_pem().unwrap();
|
rcgen::generate_simple_self_signed(["localhost".to_owned()]).unwrap();
|
||||||
let key_file = cert.serialize_private_key_pem();
|
let cert_file = cert.pem();
|
||||||
|
let key_file = key_pair.serialize_pem();
|
||||||
|
|
||||||
let cert_file = &mut BufReader::new(cert_file.as_bytes());
|
let cert_file = &mut BufReader::new(cert_file.as_bytes());
|
||||||
let key_file = &mut BufReader::new(key_file.as_bytes());
|
let key_file = &mut BufReader::new(key_file.as_bytes());
|
||||||
|
|
|
@ -130,7 +130,7 @@ env_logger = "0.11"
|
||||||
flate2 = "1.0.13"
|
flate2 = "1.0.13"
|
||||||
futures-util = { version = "0.3.17", default-features = false }
|
futures-util = { version = "0.3.17", default-features = false }
|
||||||
static_assertions = "1.1"
|
static_assertions = "1.1"
|
||||||
rcgen = "0.12"
|
rcgen = "0.13"
|
||||||
rustls-pemfile = "2"
|
rustls-pemfile = "2"
|
||||||
tokio = { version = "1.24.2", features = ["rt-multi-thread", "macros"] }
|
tokio = { version = "1.24.2", features = ["rt-multi-thread", "macros"] }
|
||||||
zstd = "0.13"
|
zstd = "0.13"
|
||||||
|
|
|
@ -13,9 +13,11 @@ use openssl::{
|
||||||
};
|
};
|
||||||
|
|
||||||
fn tls_config() -> SslAcceptor {
|
fn tls_config() -> SslAcceptor {
|
||||||
let cert = rcgen::generate_simple_self_signed(vec!["localhost".to_owned()]).unwrap();
|
let rcgen::CertifiedKey { cert, key_pair } =
|
||||||
let cert_file = cert.serialize_pem().unwrap();
|
rcgen::generate_simple_self_signed(["localhost".to_owned()]).unwrap();
|
||||||
let key_file = cert.serialize_private_key_pem();
|
let cert_file = cert.pem();
|
||||||
|
let key_file = key_pair.serialize_pem();
|
||||||
|
|
||||||
let cert = X509::from_pem(cert_file.as_bytes()).unwrap();
|
let cert = X509::from_pem(cert_file.as_bytes()).unwrap();
|
||||||
let key = PKey::private_key_from_pem(key_file.as_bytes()).unwrap();
|
let key = PKey::private_key_from_pem(key_file.as_bytes()).unwrap();
|
||||||
|
|
||||||
|
|
|
@ -23,9 +23,10 @@ use rustls::{
|
||||||
use rustls_pemfile::{certs, pkcs8_private_keys};
|
use rustls_pemfile::{certs, pkcs8_private_keys};
|
||||||
|
|
||||||
fn tls_config() -> ServerConfig {
|
fn tls_config() -> ServerConfig {
|
||||||
let cert = rcgen::generate_simple_self_signed(vec!["localhost".to_owned()]).unwrap();
|
let rcgen::CertifiedKey { cert, key_pair } =
|
||||||
let cert_file = cert.serialize_pem().unwrap();
|
rcgen::generate_simple_self_signed(["localhost".to_owned()]).unwrap();
|
||||||
let key_file = cert.serialize_private_key_pem();
|
let cert_file = cert.pem();
|
||||||
|
let key_file = key_pair.serialize_pem();
|
||||||
|
|
||||||
let cert_file = &mut BufReader::new(cert_file.as_bytes());
|
let cert_file = &mut BufReader::new(cert_file.as_bytes());
|
||||||
let key_file = &mut BufReader::new(key_file.as_bytes());
|
let key_file = &mut BufReader::new(key_file.as_bytes());
|
||||||
|
|
|
@ -19,9 +19,11 @@ use openssl::{
|
||||||
};
|
};
|
||||||
|
|
||||||
fn tls_config() -> SslAcceptor {
|
fn tls_config() -> SslAcceptor {
|
||||||
let cert = rcgen::generate_simple_self_signed(vec!["localhost".to_owned()]).unwrap();
|
let rcgen::CertifiedKey { cert, key_pair } =
|
||||||
let cert_file = cert.serialize_pem().unwrap();
|
rcgen::generate_simple_self_signed(["localhost".to_owned()]).unwrap();
|
||||||
let key_file = cert.serialize_private_key_pem();
|
let cert_file = cert.pem();
|
||||||
|
let key_file = key_pair.serialize_pem();
|
||||||
|
|
||||||
let cert = X509::from_pem(cert_file.as_bytes()).unwrap();
|
let cert = X509::from_pem(cert_file.as_bytes()).unwrap();
|
||||||
let key = PKey::private_key_from_pem(key_file.as_bytes()).unwrap();
|
let key = PKey::private_key_from_pem(key_file.as_bytes()).unwrap();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue