[pbs-devel] [PATCH proxmox-backup 1/3] config: add cipher-suites to NodeConfig

Hannes Laimer h.laimer at proxmox.com
Thu Dec 16 17:31:07 CET 2021


Signed-off-by: Hannes Laimer <h.laimer at proxmox.com>
---
 src/config/node.rs | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/config/node.rs b/src/config/node.rs
index ebbd08bd..bbffa50a 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};
 
@@ -86,6 +87,10 @@ pub struct AcmeConfig {
             schema: HTTP_PROXY_SCHEMA,
             optional: true,
         },
+        "cipher-suites": {
+            optional: true,
+            type: String,
+        },
     },
 )]
 #[derive(Deserialize, Serialize, Updater)]
@@ -113,6 +118,10 @@ pub struct NodeConfig {
 
     #[serde(skip_serializing_if = "Option::is_none")]
     pub http_proxy: Option<String>,
+
+    /// List of SSL ciphers 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: Option<String>,
 }
 
 impl NodeConfig {
@@ -164,6 +173,10 @@ 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.as_deref() {
+            dummy_acceptor.set_cipher_list(cipher_suites)?;
+        }
 
         Ok(())
     }
-- 
2.30.2






More information about the pbs-devel mailing list