add SSL context to watchtower server
This commit is contained in:
@@ -3,6 +3,7 @@ import threading
|
||||
import time
|
||||
import os
|
||||
import stat
|
||||
import ssl
|
||||
from decimal import Decimal
|
||||
from typing import Union, Optional
|
||||
from numbers import Real
|
||||
@@ -584,6 +585,14 @@ class SimpleConfig(Logger):
|
||||
device = ''
|
||||
return device
|
||||
|
||||
def get_ssl_context(self):
|
||||
ssl_keyfile = self.get('ssl_keyfile')
|
||||
ssl_certfile = self.get('ssl_certfile')
|
||||
if ssl_keyfile and ssl_certfile:
|
||||
ssl_context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
|
||||
ssl_context.load_cert_chain(ssl_certfile, ssl_keyfile)
|
||||
return ssl_context
|
||||
|
||||
|
||||
def read_user_config(path):
|
||||
"""Parse and store the user config settings in electrum.conf into user_config[]."""
|
||||
|
||||
Reference in New Issue
Block a user