From d9057588f1f02b792fcb26d94fd3a519d7ebcf5b Mon Sep 17 00:00:00 2001 From: David Lutterkort Date: Wed, 5 Mar 2025 11:10:40 +0100 Subject: [PATCH] store: Remove unused SSL support We could, in theory, establish SSL connections for the notification listener. Since that uses the same PG URL as the main connections for data through diesel, it was actually not possible to use SSL as we don't support it for our diesel connections. Until we are able to set up SSL connections across the board, remove the defunct SSL support in the notification listener. --- Cargo.lock | 27 --------------------- store/postgres/Cargo.toml | 2 -- store/postgres/src/notification_listener.rs | 11 ++------- 3 files changed, 2 insertions(+), 38 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d5d1bed6ac8..806beedf8cd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2145,9 +2145,7 @@ dependencies = [ "lazy_static", "lru_time_cache", "maybe-owned", - "openssl", "postgres", - "postgres-openssl", "pretty_assertions", "rand", "serde", @@ -3567,19 +3565,6 @@ dependencies = [ "tokio-postgres", ] -[[package]] -name = "postgres-openssl" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1de0ea6504e07ca78355a6fb88ad0f36cafe9e696cbc6717f16a207f3a60be72" -dependencies = [ - "futures 0.3.30", - "openssl", - "tokio", - "tokio-openssl", - "tokio-postgres", -] - [[package]] name = "postgres-protocol" version = "0.6.6" @@ -5174,18 +5159,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-openssl" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ffab79df67727f6acf57f1ff743091873c24c579b1e2ce4d8f53e47ded4d63d" -dependencies = [ - "futures-util", - "openssl", - "openssl-sys", - "tokio", -] - [[package]] name = "tokio-postgres" version = "0.7.10" diff --git a/store/postgres/Cargo.toml b/store/postgres/Cargo.toml index fa9ea5a20c5..d9d37db7e23 100644 --- a/store/postgres/Cargo.toml +++ b/store/postgres/Cargo.toml @@ -21,8 +21,6 @@ lazy_static = "1.5" lru_time_cache = "0.11" maybe-owned = "0.3.4" postgres = "0.19.1" -openssl = "0.10.64" -postgres-openssl = "0.5.0" rand = "0.8.4" serde = { workspace = true } serde_json = { workspace = true } diff --git a/store/postgres/src/notification_listener.rs b/store/postgres/src/notification_listener.rs index ecb7486daf2..aa817b8a371 100644 --- a/store/postgres/src/notification_listener.rs +++ b/store/postgres/src/notification_listener.rs @@ -4,10 +4,8 @@ use diesel::sql_types::Text; use graph::prelude::tokio::sync::mpsc::error::SendTimeoutError; use graph::util::backoff::ExponentialBackoff; use lazy_static::lazy_static; -use openssl::ssl::{SslConnector, SslMethod, SslVerifyMode}; -use postgres::Notification; use postgres::{fallible_iterator::FallibleIterator, Client}; -use postgres_openssl::MakeTlsConnector; +use postgres::{NoTls, Notification}; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::{Arc, Barrier, Mutex}; use std::thread; @@ -123,12 +121,7 @@ impl NotificationListener { let mut backoff = ExponentialBackoff::new(Duration::from_secs(1), Duration::from_secs(30)); loop { - let mut builder = SslConnector::builder(SslMethod::tls()) - .expect("unable to create SslConnector builder"); - builder.set_verify(SslVerifyMode::NONE); - let connector = MakeTlsConnector::new(builder.build()); - - let res = Client::connect(postgres_url, connector).and_then(|mut conn| { + let res = Client::connect(postgres_url, NoTls).and_then(|mut conn| { conn.execute(format!("LISTEN {}", channel_name).as_str(), &[])?; Ok(conn) });