rest-server: pass cipher suite/list to acceptor

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Reviewed-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2024-11-08 10:46:49 +01:00
parent 35c60f652b
commit db69867d4d

View File

@ -78,6 +78,17 @@ impl TlsAcceptorBuilder {
pub fn build(self) -> Result<SslAcceptor, Error> {
let mut acceptor = SslAcceptor::mozilla_intermediate_v5(SslMethod::tls()).unwrap();
if let Some(cipher_suites) = self.cipher_suites.as_deref() {
acceptor
.set_ciphersuites(cipher_suites)
.context("failed to set tls acceptor cipher suites")?;
}
if let Some(cipher_list) = self.cipher_list.as_deref() {
acceptor
.set_cipher_list(cipher_list)
.context("failed to set tls acceptor cipher list")?;
}
match self.tls {
Some(Tls::KeyCert(key, cert)) => {
acceptor