Browse Source

Correct determination of certificate paths for getssl

Helmut Pozimski 10 months ago
parent
commit
8616a2ea7a
2 changed files with 3 additions and 3 deletions
  1. 1 1
      amulib/apache.py
  2. 2 2
      amulib/cert_path_provider.py

+ 1 - 1
amulib/apache.py

@@ -61,7 +61,7 @@ def run(cert_path_provider: CertPathProvider, config=None,
     for vhost_entry in parsed_vhosts:
         main_domain = vhost_entry.get_main_domain()
         try:
-            with open(main_domain, "r") as cert_file:
+            with open(vhost_entry.get_cert_path(), "r") as cert_file:
                 cert_text = cert_file.read()
         except IOError:
             LOGGER.error("Error while opening cert file %s ", vhost_entry.get_cert_path())

+ 2 - 2
amulib/cert_path_provider.py

@@ -42,7 +42,7 @@ class GetSslCertPathProvider(CertPathProvider):
         return os.path.join(self._acme_dir, fqdn, file_name)
 
     def provide_fullchain_path(self, fqdn: str) -> ntpath:
-        self._join_paths(fqdn, "fullchain.crt")
+        return self._join_paths(fqdn, "fullchain.crt")
 
     def provide_key_path(self, fqdn: str) -> ntpath:
-        self._join_paths(fqdn, fqdn + ".key")
+        return self._join_paths(fqdn, fqdn + ".key")