all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com, pbs-devel@lists.proxmox.com
Subject: [PATCH proxmox v4 3/8] http: tls: add warning if old check behavior is enabled and triggered
Date: Wed,  1 Jul 2026 12:30:47 +0200	[thread overview]
Message-ID: <20260701103120.1593265-4-d.csapak@proxmox.com> (raw)
In-Reply-To: <20260701103120.1593265-1-d.csapak@proxmox.com>

only warn if we encounter the situation that a given fingerprint does
not match but we accept it anyway since openssl has priority due to
PROXMOX_OLD_TLS_CHECK=1.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 proxmox-http/Cargo.toml | 2 ++
 proxmox-http/src/tls.rs | 8 ++++++++
 2 files changed, 10 insertions(+)

diff --git a/proxmox-http/Cargo.toml b/proxmox-http/Cargo.toml
index cdc2861b..8a6af43c 100644
--- a/proxmox-http/Cargo.toml
+++ b/proxmox-http/Cargo.toml
@@ -21,6 +21,7 @@ http-body = { workspace = true, optional = true }
 http-body-util = { workspace = true, optional = true }
 hyper = { workspace = true, optional = true }
 hyper-util = { workspace = true, optional = true, features = ["http2"] }
+log = { workspace = true, optional = true }
 native-tls = { workspace = true, optional = true }
 openssl =  { version = "0.10", optional = true }
 serde = { workspace = true, optional = true }
@@ -110,6 +111,7 @@ websocket = [
     "body",
 ]
 tls = [
+    "dep:log",
     "dep:openssl",
     "dep:hex",
     "dep:thiserror",
diff --git a/proxmox-http/src/tls.rs b/proxmox-http/src/tls.rs
index abdf51e9..3c68be9d 100644
--- a/proxmox-http/src/tls.rs
+++ b/proxmox-http/src/tls.rs
@@ -176,6 +176,14 @@ pub fn openssl_verify_callback(
     let old_check = matches!(std::env::var(PROXMOX_OLD_TLS_CHECK_VAR).as_deref(), Ok("1"));
 
     if old_check && openssl_valid {
+        if ctx.error_depth() == 0 && expected_fp.is_some() && expected_fp != get_leaf_fp(ctx).ok() {
+            log::warn!(
+                "Mismatched fingerprint given, but openssl result was valid, ignoring fingerprint!"
+            );
+            log::warn!(
+                "To switch to new behavior remove PROXMOX_OLD_TLS_CHECK=1 from your environment."
+            );
+        }
         return Ok(());
     }
 
-- 
2.47.3





  parent reply	other threads:[~2026-07-01 10:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-01 10:30 [PATCH proxmox{,-backup,-websocket-tunnel} v4 0/8] unify openssl callback logic Dominik Csapak
2026-07-01 10:30 ` [PATCH proxmox v4 1/8] http: factor out openssl verification callback Dominik Csapak
2026-07-01 10:30 ` [PATCH proxmox v4 2/8] http: tls: use legacy behavior when PROXMOX_OLD_TLS_CHECK is set to "1" Dominik Csapak
2026-07-01 13:36   ` Shannon Sterz
2026-07-01 10:30 ` Dominik Csapak [this message]
2026-07-01 10:30 ` [PATCH proxmox v4 4/8] http: tls: add integration tests for openssl verify callbacks Dominik Csapak
2026-07-01 10:30 ` [PATCH proxmox v4 5/8] client: use proxmox-http's openssl verification callback Dominik Csapak
2026-07-01 10:30 ` [PATCH proxmox-backup v4 6/8] pbs-client: use proxmox-https openssl callback Dominik Csapak
2026-07-01 13:36   ` Shannon Sterz
2026-07-01 10:30 ` [PATCH proxmox-backup v4 7/8] pbs-client: honor already verified fingerprint Dominik Csapak
2026-07-01 10:30 ` [PATCH proxmox-websocket-tunnel v4 8/8] use proxmox-http's openssl callback Dominik Csapak
2026-07-01 13:35   ` Shannon Sterz
2026-07-01 13:35 ` [PATCH proxmox{,-backup,-websocket-tunnel} v4 0/8] unify openssl callback logic Shannon Sterz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260701103120.1593265-4-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal