Only create self-signed certificate if enabled

This commit is contained in:
JonnyWong16 2016-02-13 16:31:04 -08:00
commit e1c7a37f62

View file

@ -33,7 +33,8 @@ def initialize(options):
if enable_https:
# If either the HTTPS certificate or key do not exist, try to make self-signed ones.
if not (https_cert and os.path.exists(https_cert)) or not (https_key and os.path.exists(https_key)):
if plexpy.CONFIG.HTTPS_CREATE_CERT and \
(not (https_cert and os.path.exists(https_cert)) or not (https_key and os.path.exists(https_key))):
if not create_https_certificates(https_cert, https_key):
logger.warn("Unable to create certificate and key. Disabling HTTPS")
enable_https = False