Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
217 changes: 202 additions & 15 deletions Cargo.lock

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,9 @@ name = "ring"
wrappers = [
# Third-party crate — TODO: track upstream migration.
"aws-config",
# TODO: remove tokio-postgres-rustls dep from environmentd tests
# and use mz-tls-util::MakeRustlsConnect instead.
"tokio-postgres-rustls",
]

# Use `aws_lc_rs::pbkdf2` instead.
Expand Down
1 change: 0 additions & 1 deletion src/mz-debug/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ mz-ore = { path = "../ore", features = ["cli", "test"] }
mz-server-core = { path = "../server-core"}
mz-sql-parser = { path = "../sql-parser" }
mz-tls-util = { path = "../tls-util" }
postgres-openssl = { version = "0.5.2" }
regex = "1.12.3"
reqwest = { version = "0.12.28", features = ["stream"] }
serde = "1.0.219"
Expand Down
8 changes: 4 additions & 4 deletions src/mz-debug/src/system_catalog_dumper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use tokio_util::io::StreamReader;
use mz_ore::collections::HashMap;
use mz_ore::retry::{self};
use mz_ore::task::{self, JoinHandle};
use postgres_openssl::{MakeTlsConnector, TlsStream};
use mz_tls_util::MakeRustlsConnect;
use tracing::{info, warn};

#[derive(Debug, Clone)]
Expand Down Expand Up @@ -578,7 +578,7 @@ impl fmt::Display for ClusterReplica {
pub struct SystemCatalogDumper {
base_path: PathBuf,
pg_client: Arc<Mutex<PgClient>>,
pg_tls: MakeTlsConnector,
pg_tls: MakeRustlsConnect,
cluster_replicas: Vec<ClusterReplica>,
_pg_conn_handle: JoinHandle<Result<(), tokio_postgres::Error>>,
}
Expand All @@ -588,8 +588,8 @@ pub async fn create_postgres_connection(
) -> Result<
(
PgClient,
Connection<Socket, TlsStream<Socket>>,
MakeTlsConnector,
Connection<Socket, mz_tls_util::RustlsTlsStream<Socket>>,
MakeRustlsConnect,
),
anyhow::Error,
> {
Expand Down
2 changes: 1 addition & 1 deletion src/postgres-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ impl PostgresClient {

let tls = mz_tls_util::make_tls(&pg_config).map_err(|tls_err| match tls_err {
mz_tls_util::TlsError::Generic(e) => PostgresError::Indeterminate(e),
mz_tls_util::TlsError::OpenSsl(e) => PostgresError::Indeterminate(anyhow::anyhow!(e)),
mz_tls_util::TlsError::Rustls(e) => PostgresError::Indeterminate(anyhow::anyhow!(e)),
})?;

let manager = Manager::from_config(
Expand Down
2 changes: 0 additions & 2 deletions src/postgres-util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ mz-repr = { path = "../repr", optional = true }
mz-sql-parser = { path = "../sql-parser" }
mz-ssh-util = { path = "../ssh-util", optional = true }
mz-tls-util = { path = "../tls-util", default-features = false }
openssl = { version = "0.10.76", features = ["vendored"] }
openssh = { version = "0.11.6", default-features = false, features = [
"native-mux",
], optional = true }
postgres_array = { version = "0.11.0", optional = true }
postgres-openssl = { version = "0.5.2" }
proptest = { version = "1.10.0", default-features = false, features = [
"std",
], optional = true }
Expand Down
4 changes: 2 additions & 2 deletions src/postgres-util/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ pub enum PostgresError {
#[error(transparent)]
Postgres(#[from] tokio_postgres::Error),
/// Error setting up postgres ssl.
#[error(transparent)]
PostgresSsl(#[from] openssl::error::ErrorStack),
#[error("error setting up postgres TLS: {0}")]
PostgresSsl(#[source] anyhow::Error),
#[error("query returned more rows than expected")]
UnexpectedRow,
/// Cannot find publication
Expand Down
5 changes: 3 additions & 2 deletions src/postgres-util/src/tunnel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ impl Config {

let mut tls = mz_tls_util::make_tls(&postgres_config).map_err(|tls_err| match tls_err {
mz_tls_util::TlsError::Generic(e) => PostgresError::Generic(e),
mz_tls_util::TlsError::OpenSsl(e) => PostgresError::PostgresSsl(e),
mz_tls_util::TlsError::Rustls(e) => PostgresError::PostgresSsl(anyhow::anyhow!(e)),
})?;

match &self.tunnel {
Expand Down Expand Up @@ -245,7 +245,8 @@ impl Config {
.await
.map_err(PostgresError::Ssh)?;

let tls = MakeTlsConnect::<TokioTcpStream>::make_tls_connect(&mut tls, host)?;
let tls = MakeTlsConnect::<TokioTcpStream>::make_tls_connect(&mut tls, host)
.map_err(|e| PostgresError::PostgresSsl(anyhow::anyhow!(e)))?;
let tcp_stream = TokioTcpStream::connect(tunnel.local_addr())
.await
.map_err(PostgresError::SshIo)?;
Expand Down
6 changes: 3 additions & 3 deletions src/tls-util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ workspace = true
[dependencies]
anyhow = "1.0.102"
mz-ore = { path = "../ore" }
openssl = { version = "0.10.76", features = ["vendored"] }
openssl-sys = { version = "0.9.108", features = ["vendored"] }
postgres-openssl = { version = "0.5.2" }
rustls = { version = "0.23", default-features = false, features = ["aws_lc_rs", "std"] }
rustls-pki-types = { version = "1", features = ["std"] }
thiserror = "2.0.18"
tokio = { version = "1.49.0", default-features = false, features = ["fs", "macros", "sync", "rt", "rt-multi-thread"] }
tokio-postgres = { version = "0.7.15" }
tokio-rustls = { version = "0.26" }
tracing = "0.1.44"

[dev-dependencies]
Expand Down
Loading
Loading