]> git.proxmox.com Git - proxmox-backup.git/commitdiff
proxy: use ciphers from config if set
authorHannes Laimer <h.laimer@proxmox.com>
Tue, 11 Jan 2022 11:39:36 +0000 (12:39 +0100)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Fri, 14 Jan 2022 10:02:07 +0000 (11:02 +0100)
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
src/bin/proxmox-backup-proxy.rs

index 903dd9bc5199afac565d0a644d108158acc18f28..909a4b41dff9212451e75ccac6d8be08361db342 100644 (file)
@@ -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)