| Date: Fri, 9 Apr 2021 12:12:53 +0200
Remove TLS certificate references.
This won't be used in future Electrum, and lntransport shall be used instead.
Diffstat:
M electrumobelisk/protocol.py | 6 ++----
M obelisk.py | 25 +------------------------
M res/obelisk.cfg | 4 ----
3 files changed, 3 insertions(+), 32 deletions(-)
--- |
| t@@ -604,10 +604,8 @@ class ElectrumProtocol(asyncio.Protocol): # pylint: disable=R0904,R0902
"genesis_hash": self.genesis,
"hosts": {
cfg["server_hostname"]: {
- "tcp_port":
- None if cfg["using_tls"] else cfg["server_port"],
- "ssl_port":
- cfg["server_port"] if cfg["using_tls"] else None,
+ "tcp_port": cfg["server_port"],
+ "ssl_port": None,
},
},
"protocol_max": SERVER_PROTO_MAX, |
| t@@ -19,11 +19,9 @@ import sys
from argparse import ArgumentParser
from configparser import RawConfigParser, NoSectionError
from logging import getLogger, FileHandler, Formatter, StreamHandler, DEBUG
-from os.path import exists, join
+from os.path import join
from tempfile import gettempdir
-from pkg_resources import resource_filename
-
from electrumobelisk.protocol import ElectrumProtocol, VERSION
# Used for destructor/cleanup
t@@ -58,31 +56,11 @@ def logger_config(log, config):
return log, filename
-def get_certs(config):
- """Get file paths to TLS cert and key"""
- certfile = config.get("obelisk", "certfile", fallback=None)
- keyfile = config.get("obelisk", "keyfile", fallback=None)
- if (certfile and keyfile) and (exists(certfile) and exists(keyfile)):
- return certfile, keyfile
-
- certfile = resource_filename("electrumobelisk", "certs/cert.pem")
- keyfile = resource_filename("electrumobelisk", "certs/cert.key")
- if exists(certfile) and exists(keyfile):
- return certfile, keyfile
-
- raise ValueError(f"TLS keypair not found ({certfile}, {keyfile})")
-
-
async def run_electrum_server(config, chain):
"""Server coroutine"""
log = getLogger("obelisk")
host = config.get("obelisk", "host")
port = int(config.get("obelisk", "port"))
- usetls = config.getboolean("obelisk", "usetls", fallback=False)
-
- if usetls:
- certfile, keyfile = get_certs(config)
- log.debug("Using TLS with keypair: %s , %s", certfile, keyfile)
broadcast_method = config.get("obelisk",
"broadcast_method",
t@@ -101,7 +79,6 @@ async def run_electrum_server(config, chain):
server_cfg["broadcast_method"] = broadcast_method
server_cfg["server_hostname"] = "localhost" # TODO: <- should be public?
server_cfg["server_port"] = port
- server_cfg["using_tls"] = usetls
global PROTOCOL
PROTOCOL = ElectrumProtocol(log, chain, endpoints, server_cfg) |