mirror of
https://git.asonix.dog/asonix/pict-rs.git
synced 2024-11-28 04:21:12 +00:00
Merge branch 'main' into asonix/update-tokio-postgres-rustls
This commit is contained in:
commit
d7dc2e506d
5 changed files with 25 additions and 28 deletions
31
Cargo.lock
generated
31
Cargo.lock
generated
|
@ -37,9 +37,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "actix-http"
|
name = "actix-http"
|
||||||
version = "3.6.0"
|
version = "3.7.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d223b13fd481fc0d1f83bb12659ae774d9e3601814c68a0bc539731698cca743"
|
checksum = "4eb9843d84c775696c37d9a418bbb01b932629d01870722c0f13eb3f95e2536d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"actix-codec",
|
"actix-codec",
|
||||||
"actix-rt",
|
"actix-rt",
|
||||||
|
@ -47,7 +47,7 @@ dependencies = [
|
||||||
"actix-tls",
|
"actix-tls",
|
||||||
"actix-utils",
|
"actix-utils",
|
||||||
"ahash",
|
"ahash",
|
||||||
"base64 0.21.7",
|
"base64 0.22.1",
|
||||||
"bitflags 2.5.0",
|
"bitflags 2.5.0",
|
||||||
"bytes",
|
"bytes",
|
||||||
"bytestring",
|
"bytestring",
|
||||||
|
@ -97,13 +97,14 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "actix-router"
|
name = "actix-router"
|
||||||
version = "0.5.2"
|
version = "0.5.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d22475596539443685426b6bdadb926ad0ecaefdfc5fb05e5e3441f15463c511"
|
checksum = "13d324164c51f63867b57e73ba5936ea151b8a41a1d23d1031eeb9f70d0236f8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytestring",
|
"bytestring",
|
||||||
|
"cfg-if",
|
||||||
"http 0.2.12",
|
"http 0.2.12",
|
||||||
"regex",
|
"regex-lite",
|
||||||
"serde",
|
"serde",
|
||||||
"tracing",
|
"tracing",
|
||||||
]
|
]
|
||||||
|
@ -150,9 +151,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "actix-tls"
|
name = "actix-tls"
|
||||||
version = "3.3.0"
|
version = "3.4.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d4cce60a2f2b477bc72e5cde0af1812a6e82d8fd85b5570a5dcf2a5bf2c5be5f"
|
checksum = "ac453898d866cdbecdbc2334fe1738c747b4eba14a677261f2b768ba05329389"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"actix-rt",
|
"actix-rt",
|
||||||
"actix-service",
|
"actix-service",
|
||||||
|
@ -162,7 +163,7 @@ dependencies = [
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
"rustls-pki-types",
|
"rustls-pki-types",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-rustls 0.25.0",
|
"tokio-rustls 0.26.0",
|
||||||
"tokio-util",
|
"tokio-util",
|
||||||
"tracing",
|
"tracing",
|
||||||
]
|
]
|
||||||
|
@ -179,8 +180,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "actix-web"
|
name = "actix-web"
|
||||||
version = "4.5.1"
|
version = "4.6.0"
|
||||||
source = "git+https://github.com/asonix/actix-web?branch=asonix/avoid-double-into-type-inference#0314cbee17c60e98890e59f1424d63ed9669782e"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b1cf67dadb19d7c95e5a299e2dda24193b89d5d4f33a3b9800888ede9e19aa32"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"actix-codec",
|
"actix-codec",
|
||||||
"actix-http",
|
"actix-http",
|
||||||
|
@ -2019,7 +2021,6 @@ dependencies = [
|
||||||
"reqwest",
|
"reqwest",
|
||||||
"reqwest-middleware",
|
"reqwest-middleware",
|
||||||
"reqwest-tracing",
|
"reqwest-tracing",
|
||||||
"rustls 0.22.4",
|
|
||||||
"rustls 0.23.7",
|
"rustls 0.23.7",
|
||||||
"rustls-channel-resolver",
|
"rustls-channel-resolver",
|
||||||
"rustls-pemfile",
|
"rustls-pemfile",
|
||||||
|
@ -2570,12 +2571,12 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustls-channel-resolver"
|
name = "rustls-channel-resolver"
|
||||||
version = "0.2.0"
|
version = "0.3.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ffbd1941204442f051576a9a7ea8e8db074ad7fd43db1eb3378c3633f9f9e166"
|
checksum = "fede2a247359da6b4998f7723ec6468c2d6a577a5d8c17e54f21806426ad2290"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"nanorand",
|
"nanorand",
|
||||||
"rustls 0.22.4",
|
"rustls 0.23.7",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
10
Cargo.toml
10
Cargo.toml
|
@ -20,7 +20,7 @@ random-errors = ["dep:nanorand"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
actix-form-data = "0.7.0-beta.7"
|
actix-form-data = "0.7.0-beta.7"
|
||||||
actix-web = { version = "4.0.0", default-features = false, features = ["rustls-0_22"] }
|
actix-web = { version = "4.6.0", default-features = false, features = ["rustls-0_23"] }
|
||||||
async-trait = "0.1.51"
|
async-trait = "0.1.51"
|
||||||
barrel = { version = "0.7.0", features = ["pg"] }
|
barrel = { version = "0.7.0", features = ["pg"] }
|
||||||
base64 = "0.22.0"
|
base64 = "0.22.0"
|
||||||
|
@ -50,11 +50,10 @@ reqwest = { version = "0.12.0", default-features = false, features = ["json", "r
|
||||||
reqwest-middleware = "0.3.0"
|
reqwest-middleware = "0.3.0"
|
||||||
reqwest-tracing = "0.5.0"
|
reqwest-tracing = "0.5.0"
|
||||||
# pinned to tokio-postgres-generic-rustls
|
# pinned to tokio-postgres-generic-rustls
|
||||||
rustls023 = { package = "rustls", version = "0.23" }
|
|
||||||
# pinned to actix-web
|
# pinned to actix-web
|
||||||
rustls = { package = "rustls", version = "0.22.0", default-features = false, features = ["ring"] }
|
rustls = "0.23"
|
||||||
# pinned to rustls
|
# pinned to rustls
|
||||||
rustls-channel-resolver = "0.2.0"
|
rustls-channel-resolver = "0.3.0"
|
||||||
# pinned to rustls
|
# pinned to rustls
|
||||||
rustls-pemfile = "2.0.0"
|
rustls-pemfile = "2.0.0"
|
||||||
rusty-s3 = "0.5.0"
|
rusty-s3 = "0.5.0"
|
||||||
|
@ -98,6 +97,3 @@ webpki-roots = "0.26.0"
|
||||||
version = "0.7.10"
|
version = "0.7.10"
|
||||||
default-features = false
|
default-features = false
|
||||||
features = ["emit_event_on_error", "opentelemetry_0_22"]
|
features = ["emit_event_on_error", "opentelemetry_0_22"]
|
||||||
|
|
||||||
[patch.crates-io]
|
|
||||||
actix-web = { git = "https://github.com/asonix/actix-web", branch = "asonix/avoid-double-into-type-inference" }
|
|
||||||
|
|
|
@ -1764,7 +1764,7 @@ async fn launch<
|
||||||
|
|
||||||
tracing::info!("Starting pict-rs with TLS on {address}");
|
tracing::info!("Starting pict-rs with TLS on {address}");
|
||||||
|
|
||||||
server.bind_rustls_0_22(address, config)?.run().await?;
|
server.bind_rustls_0_23(address, config)?.run().await?;
|
||||||
|
|
||||||
handle.abort();
|
handle.abort();
|
||||||
let _ = handle.await;
|
let _ = handle.await;
|
||||||
|
@ -1942,7 +1942,7 @@ impl PictRsConfiguration {
|
||||||
///
|
///
|
||||||
/// This would happen automatically anyway unless rustls crate features get mixed up
|
/// This would happen automatically anyway unless rustls crate features get mixed up
|
||||||
pub fn install_crypto_provider(self) -> Self {
|
pub fn install_crypto_provider(self) -> Self {
|
||||||
if rustls023::crypto::aws_lc_rs::default_provider()
|
if rustls::crypto::aws_lc_rs::default_provider()
|
||||||
.install_default()
|
.install_default()
|
||||||
.is_err()
|
.is_err()
|
||||||
{
|
{
|
||||||
|
|
|
@ -142,7 +142,7 @@ pub(crate) enum TlsError {
|
||||||
Invalid,
|
Invalid,
|
||||||
|
|
||||||
#[error("Couldn't add certificate to root store")]
|
#[error("Couldn't add certificate to root store")]
|
||||||
Add(#[source] rustls023::Error),
|
Add(#[source] rustls::Error),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PostgresError {
|
impl PostgresError {
|
||||||
|
@ -174,7 +174,7 @@ impl PostgresError {
|
||||||
async fn build_tls_connector(
|
async fn build_tls_connector(
|
||||||
certificate_file: Option<PathBuf>,
|
certificate_file: Option<PathBuf>,
|
||||||
) -> Result<MakeRustlsConnect<AwsLcRsDigest>, TlsError> {
|
) -> Result<MakeRustlsConnect<AwsLcRsDigest>, TlsError> {
|
||||||
let mut cert_store = rustls023::RootCertStore {
|
let mut cert_store = rustls::RootCertStore {
|
||||||
roots: Vec::from(webpki_roots::TLS_SERVER_ROOTS),
|
roots: Vec::from(webpki_roots::TLS_SERVER_ROOTS),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -195,7 +195,7 @@ async fn build_tls_connector(
|
||||||
cert_store.add(cert).map_err(TlsError::Add)?;
|
cert_store.add(cert).map_err(TlsError::Add)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
let config = rustls023::ClientConfig::builder()
|
let config = rustls::ClientConfig::builder()
|
||||||
.with_root_certificates(cert_store)
|
.with_root_certificates(cert_store)
|
||||||
.with_no_client_auth();
|
.with_no_client_auth();
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
use rustls::{crypto::ring::sign::any_supported_type, sign::CertifiedKey, Error};
|
use rustls::{crypto::aws_lc_rs::sign::any_supported_type, sign::CertifiedKey, Error};
|
||||||
|
|
||||||
pub(super) struct Tls {
|
pub(super) struct Tls {
|
||||||
certificate: PathBuf,
|
certificate: PathBuf,
|
||||||
|
|
Loading…
Reference in a new issue