From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id C49441FF13C for ; Thu, 25 Jun 2026 13:20:10 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id A1D05D9CA; Thu, 25 Jun 2026 13:20:08 +0200 (CEST) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 25 Jun 2026 13:19:51 +0200 Message-Id: To: "Dominik Csapak" , , Subject: Re: [PATCH proxmox-backup v3 4/6] pbs-client: use proxmox-https openssl callback X-Mailer: aerc 0.20.0 References: <20260617085949.1528300-1-d.csapak@proxmox.com> <20260617085949.1528300-5-d.csapak@proxmox.com> In-Reply-To: <20260617085949.1528300-5-d.csapak@proxmox.com> From: "Shannon Sterz" X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1782386386605 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.106 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: FDGGEACOSWSGMGNSTNPHBN4UUCI7ODPP X-Message-ID-Hash: FDGGEACOSWSGMGNSTNPHBN4UUCI7ODPP X-MailFrom: s.sterz@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Wed Jun 17, 2026 at 10:59 AM CEST, Dominik Csapak wrote: > instead of implementing it here. This changes the behavior when giving a > fingerprint explicitly when the certificate chain is trusted by openssl. > Previously this would be accepted due to openssls checks, regardless if > the given fingerprint would match or not. > > With this patch, a given fingerprint has higher priority than openssls > validation. > > Signed-off-by: Dominik Csapak -->8 snip 8<-- > @@ -425,30 +422,42 @@ impl HttpClient { > let interactive =3D options.interactive; > let fingerprint_cache =3D options.fingerprint_cache; > let prefix =3D options.prefix.clone(); > - let trust_openssl_valid =3D Arc::new(Mutex::new(true)); > ssl_connector_builder.set_verify_callback( > openssl::ssl::SslVerifyMode::PEER, > - move |valid, ctx| match Self::verify_callback( > + move |valid, ctx| match openssl_verify_callback( > valid, > ctx, > - expected_fingerprint.as_ref(), > - interactive, > - Arc::clone(&trust_openssl_valid), > + expected_fingerprint.as_deref(), > ) { > - Ok(None) =3D> true, > - Ok(Some(fingerprint)) =3D> { > - if fingerprint_cache { > - if let Some(ref prefix) =3D prefix { > - if let Err(err) =3D store_fingerprint(pr= efix, &server, &fingerprint) { > - error!("{}", err); > + Ok(()) =3D> true, > + Err(err) =3D> { > + match err { > + SslVerifyError::NoCertificate =3D> error!( > + "certificate validation failed - context= lacks current certificate" tiny nit, i think a user is likely to misunderstand what "context" here means and might try to add a given certificate to the system's trust store. as they might assume that's the context referenced here. imo something like "certificate validation failed - could not get a certificate needed for validation from the server" might be clearer? -->8 snip 8<--