Add https certificate chain

This commit is contained in:
JonnyWong16 2017-01-15 11:49:48 -08:00
parent 285599cf90
commit 270d4f510a
5 changed files with 15 additions and 1 deletions

View file

@ -220,6 +220,7 @@ def main():
'http_proxy': plexpy.CONFIG.HTTP_PROXY, 'http_proxy': plexpy.CONFIG.HTTP_PROXY,
'enable_https': plexpy.CONFIG.ENABLE_HTTPS, 'enable_https': plexpy.CONFIG.ENABLE_HTTPS,
'https_cert': plexpy.CONFIG.HTTPS_CERT, 'https_cert': plexpy.CONFIG.HTTPS_CERT,
'https_cert_chain': plexpy.CONFIG.HTTPS_CERT_CHAIN,
'https_key': plexpy.CONFIG.HTTPS_KEY, 'https_key': plexpy.CONFIG.HTTPS_KEY,
'http_username': plexpy.CONFIG.HTTP_USERNAME, 'http_username': plexpy.CONFIG.HTTP_USERNAME,
'http_password': plexpy.CONFIG.HTTP_PASSWORD, 'http_password': plexpy.CONFIG.HTTP_PASSWORD,

View file

@ -454,7 +454,7 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="https_cert">HTTPS Cert</label> <label for="https_cert">HTTPS Certificate</label>
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<input type="text" class="form-control http-settings" id="https_cert" name="https_cert" value="${config['https_cert']}"> <input type="text" class="form-control http-settings" id="https_cert" name="https_cert" value="${config['https_cert']}">
@ -462,6 +462,15 @@
</div> </div>
<p class="help-block">The location of the SSL certificate.</p> <p class="help-block">The location of the SSL certificate.</p>
</div> </div>
<div class="form-group">
<label for="https_cert_chain">HTTPS Certificate Chain</label>
<div class="row">
<div class="col-md-6">
<input type="text" class="form-control http-settings" id="https_cert_chain" name="https_cert_chain" value="${config['https_cert_chain']}">
</div>
</div>
<p class="help-block">The location of the SSL certificate chain.</p>
</div>
<div class="form-group"> <div class="form-group">
<label for="https_key">HTTPS Key</label> <label for="https_key">HTTPS Key</label>
<div class="row"> <div class="row">

View file

@ -204,6 +204,7 @@ _CONFIG_DEFINITIONS = {
'popular_music', 'last_watched', 'top_users', 'top_platforms', 'most_concurrent']), 'popular_music', 'last_watched', 'top_users', 'top_platforms', 'most_concurrent']),
'HTTPS_CREATE_CERT': (int, 'General', 1), 'HTTPS_CREATE_CERT': (int, 'General', 1),
'HTTPS_CERT': (str, 'General', ''), 'HTTPS_CERT': (str, 'General', ''),
'HTTPS_CERT_CHAIN': (str, 'General', ''),
'HTTPS_KEY': (str, 'General', ''), 'HTTPS_KEY': (str, 'General', ''),
'HTTPS_DOMAIN': (str, 'General', 'localhost'), 'HTTPS_DOMAIN': (str, 'General', 'localhost'),
'HTTPS_IP': (str, 'General', '127.0.0.1'), 'HTTPS_IP': (str, 'General', '127.0.0.1'),

View file

@ -2525,6 +2525,7 @@ class WebInterface(object):
"enable_https": checked(plexpy.CONFIG.ENABLE_HTTPS), "enable_https": checked(plexpy.CONFIG.ENABLE_HTTPS),
"https_create_cert": checked(plexpy.CONFIG.HTTPS_CREATE_CERT), "https_create_cert": checked(plexpy.CONFIG.HTTPS_CREATE_CERT),
"https_cert": plexpy.CONFIG.HTTPS_CERT, "https_cert": plexpy.CONFIG.HTTPS_CERT,
"https_cert_chain": plexpy.CONFIG.HTTPS_CERT_CHAIN,
"https_key": plexpy.CONFIG.HTTPS_KEY, "https_key": plexpy.CONFIG.HTTPS_KEY,
"https_domain": plexpy.CONFIG.HTTPS_DOMAIN, "https_domain": plexpy.CONFIG.HTTPS_DOMAIN,
"https_ip": plexpy.CONFIG.HTTPS_IP, "https_ip": plexpy.CONFIG.HTTPS_IP,

View file

@ -29,6 +29,7 @@ def initialize(options):
# HTTPS stuff stolen from sickbeard # HTTPS stuff stolen from sickbeard
enable_https = options['enable_https'] enable_https = options['enable_https']
https_cert = options['https_cert'] https_cert = options['https_cert']
https_cert_chain = options['https_cert_chain']
https_key = options['https_key'] https_key = options['https_key']
if enable_https: if enable_https:
@ -59,6 +60,7 @@ def initialize(options):
if enable_https: if enable_https:
options_dict['server.ssl_certificate'] = https_cert options_dict['server.ssl_certificate'] = https_cert
options_dict['server.ssl_certificate_chain'] = https_cert_chain
options_dict['server.ssl_private_key'] = https_key options_dict['server.ssl_private_key'] = https_key
protocol = "https" protocol = "https"
else: else: