mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-14 06:29:51 +00:00
new command: get_ssl_domain
This commit is contained in:
parent
fbc539e2cc
commit
b891d3dc85
3 changed files with 20 additions and 10 deletions
|
@ -298,6 +298,12 @@ class Commands:
|
||||||
self.config.set_key(key, value)
|
self.config.set_key(key, value)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@command('')
|
||||||
|
async def get_ssl_domain(self):
|
||||||
|
"""Check and return the SSL domain set in ssl_keyfile and ssl_certfile
|
||||||
|
"""
|
||||||
|
return self.config.get_ssl_domain()
|
||||||
|
|
||||||
@command('')
|
@command('')
|
||||||
async def make_seed(self, nbits=132, language=None, seed_type=None):
|
async def make_seed(self, nbits=132, language=None, seed_type=None):
|
||||||
"""Create a seed"""
|
"""Create a seed"""
|
||||||
|
|
|
@ -564,17 +564,13 @@ that is always connected to the internet. Configure a port if you want it to be
|
||||||
self.check_ssl_config()
|
self.check_ssl_config()
|
||||||
|
|
||||||
def check_ssl_config(self):
|
def check_ssl_config(self):
|
||||||
if self.config.get('ssl_keyfile') and self.config.get('ssl_certfile'):
|
|
||||||
try:
|
try:
|
||||||
SSL_identity = paymentrequest.check_ssl_config(self.config)
|
SSL_identity = self.config.get_ssl_domain()
|
||||||
SSL_error = None
|
SSL_error = None
|
||||||
except BaseException as e:
|
except BaseException as e:
|
||||||
SSL_identity = "error"
|
SSL_identity = "error"
|
||||||
SSL_error = repr(e)
|
SSL_error = repr(e)
|
||||||
else:
|
self.ssl_domain_e.setText(SSL_identity or "")
|
||||||
SSL_identity = ""
|
|
||||||
SSL_error = None
|
|
||||||
self.ssl_domain_e.setText(SSL_identity)
|
|
||||||
s = (ColorScheme.RED if SSL_error else ColorScheme.GREEN).as_stylesheet(True) if SSL_identity else ''
|
s = (ColorScheme.RED if SSL_error else ColorScheme.GREEN).as_stylesheet(True) if SSL_identity else ''
|
||||||
self.ssl_domain_e.setStyleSheet(s)
|
self.ssl_domain_e.setStyleSheet(s)
|
||||||
if SSL_error:
|
if SSL_error:
|
||||||
|
|
|
@ -584,6 +584,14 @@ class SimpleConfig(Logger):
|
||||||
ssl_context.load_cert_chain(ssl_certfile, ssl_keyfile)
|
ssl_context.load_cert_chain(ssl_certfile, ssl_keyfile)
|
||||||
return ssl_context
|
return ssl_context
|
||||||
|
|
||||||
|
def get_ssl_domain(self):
|
||||||
|
from .paymentrequest import check_ssl_config
|
||||||
|
if self.get('ssl_keyfile') and self.get('ssl_certfile'):
|
||||||
|
SSL_identity = check_ssl_config(self)
|
||||||
|
else:
|
||||||
|
SSL_identity = None
|
||||||
|
return SSL_identity
|
||||||
|
|
||||||
|
|
||||||
def read_user_config(path):
|
def read_user_config(path):
|
||||||
"""Parse and store the user config settings in electrum.conf into user_config[]."""
|
"""Parse and store the user config settings in electrum.conf into user_config[]."""
|
||||||
|
|
Loading…
Add table
Reference in a new issue