mirror of
https://git.asonix.dog/asonix/pict-rs
synced 2024-12-22 11:21:24 +00:00
Update rustls for tokio-postgres
This doesn't update rustls for actix-web (0.22), or rustls for reqwest (0.21)
This commit is contained in:
parent
d45e3fa386
commit
64b8635059
3 changed files with 36 additions and 23 deletions
49
Cargo.lock
generated
49
Cargo.lock
generated
|
@ -958,20 +958,6 @@ dependencies = [
|
||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "futures"
|
|
||||||
version = "0.3.30"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0"
|
|
||||||
dependencies = [
|
|
||||||
"futures-channel",
|
|
||||||
"futures-core",
|
|
||||||
"futures-io",
|
|
||||||
"futures-sink",
|
|
||||||
"futures-task",
|
|
||||||
"futures-util",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "futures-channel"
|
name = "futures-channel"
|
||||||
version = "0.3.30"
|
version = "0.3.30"
|
||||||
|
@ -1843,6 +1829,7 @@ dependencies = [
|
||||||
"reqwest-middleware",
|
"reqwest-middleware",
|
||||||
"reqwest-tracing",
|
"reqwest-tracing",
|
||||||
"rustls 0.22.4",
|
"rustls 0.22.4",
|
||||||
|
"rustls 0.23.5",
|
||||||
"rustls-channel-resolver",
|
"rustls-channel-resolver",
|
||||||
"rustls-pemfile 2.1.2",
|
"rustls-pemfile 2.1.2",
|
||||||
"rusty-s3",
|
"rusty-s3",
|
||||||
|
@ -2353,6 +2340,20 @@ dependencies = [
|
||||||
"zeroize",
|
"zeroize",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rustls"
|
||||||
|
version = "0.23.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "afabcee0551bd1aa3e18e5adbf2c0544722014b899adb31bd186ec638d3da97e"
|
||||||
|
dependencies = [
|
||||||
|
"once_cell",
|
||||||
|
"ring",
|
||||||
|
"rustls-pki-types",
|
||||||
|
"rustls-webpki 0.102.3",
|
||||||
|
"subtle",
|
||||||
|
"zeroize",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustls-channel-resolver"
|
name = "rustls-channel-resolver"
|
||||||
version = "0.2.0"
|
version = "0.2.0"
|
||||||
|
@ -2928,16 +2929,15 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tokio-postgres-rustls"
|
name = "tokio-postgres-rustls"
|
||||||
version = "0.11.1"
|
version = "0.12.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0ea13f22eda7127c827983bdaf0d7fff9df21c8817bab02815ac277a21143677"
|
checksum = "04fb792ccd6bbcd4bba408eb8a292f70fc4a3589e5d793626f45190e6454b6ab"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"futures",
|
|
||||||
"ring",
|
"ring",
|
||||||
"rustls 0.22.4",
|
"rustls 0.23.5",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-postgres",
|
"tokio-postgres",
|
||||||
"tokio-rustls 0.25.0",
|
"tokio-rustls 0.26.0",
|
||||||
"x509-certificate",
|
"x509-certificate",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2962,6 +2962,17 @@ dependencies = [
|
||||||
"tokio",
|
"tokio",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tokio-rustls"
|
||||||
|
version = "0.26.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4"
|
||||||
|
dependencies = [
|
||||||
|
"rustls 0.23.5",
|
||||||
|
"rustls-pki-types",
|
||||||
|
"tokio",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tokio-stream"
|
name = "tokio-stream"
|
||||||
version = "0.1.15"
|
version = "0.1.15"
|
||||||
|
|
|
@ -50,6 +50,8 @@ reqwest = { version = "0.11.18", default-features = false, features = ["json", "
|
||||||
reqwest-middleware = "0.2.2"
|
reqwest-middleware = "0.2.2"
|
||||||
reqwest-tracing = "0.4.5"
|
reqwest-tracing = "0.4.5"
|
||||||
# pinned to tokio-postgres-rustls
|
# pinned to tokio-postgres-rustls
|
||||||
|
rustls023 = { package = "rustls", version = "0.23", default-features = false, features = ["ring"] }
|
||||||
|
# pinned to actix-web
|
||||||
rustls = "0.22.0"
|
rustls = "0.22.0"
|
||||||
# pinned to rustls
|
# pinned to rustls
|
||||||
rustls-channel-resolver = "0.2.0"
|
rustls-channel-resolver = "0.2.0"
|
||||||
|
@ -68,7 +70,7 @@ thiserror = "1.0"
|
||||||
time = { version = "0.3.0", features = ["serde", "serde-well-known"] }
|
time = { version = "0.3.0", features = ["serde", "serde-well-known"] }
|
||||||
tokio = { version = "1", features = ["full", "tracing"] }
|
tokio = { version = "1", features = ["full", "tracing"] }
|
||||||
tokio-postgres = { version = "0.7.10", features = ["with-uuid-1", "with-time-0_3", "with-serde_json-1"] }
|
tokio-postgres = { version = "0.7.10", features = ["with-uuid-1", "with-time-0_3", "with-serde_json-1"] }
|
||||||
tokio-postgres-rustls = "0.11.0"
|
tokio-postgres-rustls = "0.12.0"
|
||||||
tokio-uring = { version = "0.4", optional = true, features = ["bytes"] }
|
tokio-uring = { version = "0.4", optional = true, features = ["bytes"] }
|
||||||
tokio-util = { version = "0.7", default-features = false, features = [
|
tokio-util = { version = "0.7", default-features = false, features = [
|
||||||
"codec",
|
"codec",
|
||||||
|
|
|
@ -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] rustls::Error),
|
Add(#[source] rustls023::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, TlsError> {
|
) -> Result<MakeRustlsConnect, TlsError> {
|
||||||
let mut cert_store = rustls::RootCertStore {
|
let mut cert_store = rustls023::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 = rustls::ClientConfig::builder()
|
let config = rustls023::ClientConfig::builder()
|
||||||
.with_root_certificates(cert_store)
|
.with_root_certificates(cert_store)
|
||||||
.with_no_client_auth();
|
.with_no_client_auth();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue