# SPDX-FileCopyrightText: 2016-2017 Helmut Pozimski # # SPDX-License-Identifier: GPL-2.0-only # -*- coding: utf8 -*- """ collection of helper functions used in other modules of acme-updater. """ import logging import datetime import os import shutil import hashlib import OpenSSL import dns.tsigkeyring import dns.update import dns.query LOGGER = logging.getLogger("acme-updater") def parse_apache_vhost(file_obj): """ Parses a given vhost file and extracts the main domain, the certificate file, the TLS key file and all domains contained within the vhost. :param file_obj: file obj pointing to a vhost to parse :return: list of tuples with domains and found certificates :rtype: list """ vhost_started = False parsed_info = [] cert_path = "" key_path = "" main_domain = "" domains = set() for line in file_obj: if "