public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Hannes Laimer <h.laimer@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup v4 2/3] proxy: use ciphers from config if set
Date: Tue, 11 Jan 2022 12:39:36 +0100	[thread overview]
Message-ID: <20220111113937.26246-3-h.laimer@proxmox.com> (raw)
In-Reply-To: <20220111113937.26246-1-h.laimer@proxmox.com>

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
---
 src/bin/proxmox-backup-proxy.rs | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/bin/proxmox-backup-proxy.rs b/src/bin/proxmox-backup-proxy.rs
index 903dd9bc..909a4b41 100644
--- a/src/bin/proxmox-backup-proxy.rs
+++ b/src/bin/proxmox-backup-proxy.rs
@@ -342,7 +342,17 @@ fn make_tls_acceptor() -> Result<SslAcceptor, Error> {
     let key_path = configdir!("/proxy.key");
     let cert_path = configdir!("/proxy.pem");
 
+    let (config, _) = proxmox_backup::config::node::config()?;
+    let ciphers_tls13 = config.ciphers_tls13;
+    let ciphers_tls12 = config.ciphers_tls12;
+
     let mut acceptor = SslAcceptor::mozilla_intermediate_v5(SslMethod::tls()).unwrap();
+    if let Some(ciphers) = ciphers_tls13.as_deref() {
+        acceptor.set_ciphersuites(ciphers)?;
+    }
+    if let Some(ciphers) = ciphers_tls12.as_deref() {
+        acceptor.set_cipher_list(ciphers)?;
+    }
     acceptor.set_private_key_file(key_path, SslFiletype::PEM)
         .map_err(|err| format_err!("unable to read proxy key {} - {}", key_path, err))?;
     acceptor.set_certificate_chain_file(cert_path)
-- 
2.30.2





  parent reply	other threads:[~2022-01-11 11:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-11 11:39 [pbs-devel] [PATCH proxmox-backup v4 0/3] close #3612: allow config of SSL cipher-suites for proxy Hannes Laimer
2022-01-11 11:39 ` [pbs-devel] [PATCH proxmox-backup v4 1/3] config: add tls ciphers to NodeConfig Hannes Laimer
2022-01-11 11:39 ` Hannes Laimer [this message]
2022-01-11 11:39 ` [pbs-devel] [PATCH proxmox-backup v4 3/3] api2: make tls ciphers updatable Hannes Laimer
2022-01-14 10:30 ` [pbs-devel] applied-series: [PATCH proxmox-backup v4 0/3] close #3612: allow config of SSL cipher-suites for proxy Fabian Grünbichler

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=20220111113937.26246-3-h.laimer@proxmox.com \
    --to=h.laimer@proxmox.com \
    --cc=pbs-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal