|
@@ -22,7 +22,6 @@ needs to at least contain the keys "certificate_path", "key_path",
|
|
|
"""
|
|
|
|
|
|
import logging
|
|
|
-import socket
|
|
|
import os
|
|
|
import subprocess
|
|
|
import shutil
|
|
@@ -46,11 +45,11 @@ def run(service_name, config, acme_dir="/var/lib/acme",
|
|
|
:param named_key_path: path to the named session.key
|
|
|
:type named_key_path: str
|
|
|
"""
|
|
|
- fqdn = socket.getfqdn()
|
|
|
certificate_path = config["certificate_path"]
|
|
|
key_path = config["key_path"]
|
|
|
tlsa = config["tlsa"]
|
|
|
tlsa_ports = config["tlsa_ports"]
|
|
|
+ renewal_successful = False
|
|
|
try:
|
|
|
with open(certificate_path, "r") as cert_file:
|
|
|
cert_text = cert_file.read()
|
|
@@ -60,6 +59,7 @@ def run(service_name, config, acme_dir="/var/lib/acme",
|
|
|
current_cert = OpenSSL.crypto.load_certificate(
|
|
|
OpenSSL.crypto.FILETYPE_PEM, cert_text
|
|
|
)
|
|
|
+ fqdn = current_cert.get_subject().CN
|
|
|
acme_cert_path = os.path.join(acme_dir, "live", fqdn,
|
|
|
"cert")
|
|
|
acme_fullchain_path = os.path.join(acme_dir, "live", fqdn,
|
|
@@ -81,7 +81,6 @@ def run(service_name, config, acme_dir="/var/lib/acme",
|
|
|
named_key_path)
|
|
|
newkey_path = os.path.join(acme_dir, "live",
|
|
|
fqdn, "privkey")
|
|
|
- renewal_successful = False
|
|
|
if certificate_path == key_path:
|
|
|
if helpers.create_backup_copy(certificate_path):
|
|
|
try:
|