From: Hannes Laimer <h.laimer@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup v2 1/3] config: add cipher-suites to NodeConfig
Date: Tue, 4 Jan 2022 12:48:24 +0100 [thread overview]
Message-ID: <20220104114826.20739-2-h.laimer@proxmox.com> (raw)
In-Reply-To: <20220104114826.20739-1-h.laimer@proxmox.com>
for TLS 1.3 and for TLS <= 1.2
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
---
src/config/node.rs | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/src/config/node.rs b/src/config/node.rs
index 4f2ab029..6a6038e6 100644
--- a/src/config/node.rs
+++ b/src/config/node.rs
@@ -1,5 +1,6 @@
use std::collections::HashSet;
+use openssl::ssl::{SslAcceptor, SslMethod};
use anyhow::{bail, Error};
use serde::{Deserialize, Serialize};
@@ -91,6 +92,14 @@ pub struct AcmeConfig {
schema: EMAIL_SCHEMA,
optional: true,
},
+ "cipher-suites-tls3": {
+ optional: true,
+ type: String,
+ },
+ "cipher-suites-tls2": {
+ optional: true,
+ type: String,
+ },
},
)]
#[derive(Deserialize, Serialize, Updater)]
@@ -121,6 +130,14 @@ pub struct NodeConfig {
#[serde(skip_serializing_if = "Option::is_none")]
pub email_from: Option<String>,
+
+ /// List of SSL ciphers for tls 1.3 that will be used by the proxy. (Proxy has to be restarted for changes to take effect)
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub cipher_suites_tls3: Option<String>,
+
+ /// List of SSL ciphers for tls <= 1.2 that will be used by the proxy. (Proxy has to be restarted for changes to take effect)
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub cipher_suites_tls2: Option<String>,
}
impl NodeConfig {
@@ -172,6 +189,13 @@ impl NodeConfig {
bail!("duplicate domain '{}' in ACME config", domain.domain);
}
}
+ let mut dummy_acceptor = SslAcceptor::mozilla_intermediate_v5(SslMethod::tls()).unwrap();
+ if let Some(cipher_suites) = self.cipher_suites_tls3.as_deref() {
+ dummy_acceptor.set_ciphersuites(cipher_suites)?;
+ }
+ if let Some(cipher_suites) = self.cipher_suites_tls2.as_deref() {
+ dummy_acceptor.set_cipher_list(cipher_suites)?;
+ }
Ok(())
}
--
2.30.2
next prev parent reply other threads:[~2022-01-04 11:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-04 11:48 [pbs-devel] [PATCH proxmox-backup v2 0/3] close #3612: allow config of SSL cipher-suites for proxy Hannes Laimer
2022-01-04 11:48 ` Hannes Laimer [this message]
2022-01-04 11:48 ` [pbs-devel] [PATCH proxmox-backup v2 2/3] proxy: use ssl cipher-suites from config if set Hannes Laimer
2022-01-04 11:48 ` [pbs-devel] [PATCH proxmox-backup v2 3/3] api2: make cipher-suites updatable Hannes Laimer
2022-01-05 8:23 [pbs-devel] [PATCH proxmox-backup v2 1/3] config: add cipher-suites to NodeConfig Dietmar Maurer
2022-01-05 8:44 Dietmar Maurer
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=20220104114826.20739-2-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