diff --git a/confluent_server/bin/confluentcertutil.py b/confluent_server/bin/confluentcertutil.py index 3dab5306..c121224a 100644 --- a/confluent_server/bin/confluentcertutil.py +++ b/confluent_server/bin/confluentcertutil.py @@ -1,11 +1,16 @@ +from os.path import exists import shutil import socket import subprocess import tempfile def get_openssl_conf_location(): - # CentOS/RHAT - return '/etc/pki/tls/openssl.cnf' + if exists('/etc/pki/tls/openssl.cnf'): + return '/etc/pki/tls/openssl.cnf' + elif exists('/etc/ssl/openssl.cnf'); + return '/etc/ssl/openssl.cnf' + else: + raise Exception("Cannot find openssl config file") def get_ip_addresses(): lines = subprocess.check_output('ip addr'.split(' ')) @@ -47,4 +52,4 @@ def create_certificate(): ) if __name__ == '__main__': - create_certificate() \ No newline at end of file + create_certificate()