]> git.proxmox.com Git - proxmox.git/commitdiff
rest-server: generic certificate path types
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 26 Jan 2023 09:47:42 +0000 (10:47 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 2 Mar 2023 15:14:04 +0000 (16:14 +0100)
to not require a PathBuf on the caller side

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
proxmox-rest-server/src/connection.rs

index 768b936189dcbd2fa684678a203cbce0666526ff..a154182f4185c6828a9dd4c930152e3875fb7d50 100644 (file)
@@ -48,8 +48,12 @@ impl TlsAcceptorBuilder {
         self
     }
 
-    pub fn certificate_paths_pem(mut self, key: PathBuf, cert: PathBuf) -> Self {
-        self.tls = Some(Tls::FilesPem(key, cert));
+    pub fn certificate_paths_pem(
+        mut self,
+        key: impl Into<PathBuf>,
+        cert: impl Into<PathBuf>,
+    ) -> Self {
+        self.tls = Some(Tls::FilesPem(key.into(), cert.into()));
         self
     }