pyOpenSSL only required for generating self-signed certificates

This commit is contained in:
JonnyWong16 2022-11-13 00:17:28 -08:00
parent ed735e5fa3
commit 05739ea959
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
2 changed files with 1 additions and 11 deletions

View file

@ -253,16 +253,6 @@ def main():
else:
plexpy.HTTP_PORT = int(plexpy.CONFIG.HTTP_PORT)
# Check if pyOpenSSL is installed. It is required for certificate generation
# and for CherryPy.
if plexpy.CONFIG.ENABLE_HTTPS:
try:
import OpenSSL
except ImportError:
logger.warn("The pyOpenSSL module is missing. Install this "
"module to enable HTTPS. HTTPS will be disabled.")
plexpy.CONFIG.ENABLE_HTTPS = False
# Try to start the server. Will exit here is address is already in use.
webstart.start()

View file

@ -486,7 +486,7 @@ def create_https_certificates(ssl_cert, ssl_key):
try:
from OpenSSL import crypto
except ImportError:
logger.error("Unable to generate self-signed certificates: Missing OpenSSL module.")
logger.error("Unable to generate self-signed certificates: Missing pyOpenSSL module.")
return False
from certgen import createKeyPair, createSelfSignedCertificate, TYPE_RSA