mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-04 21:05:11 +00:00
aiorpcx: pass ssl context, sleep after connecting
This commit is contained in:
parent
97ea0fc439
commit
8080a713b2
1 changed files with 5 additions and 1 deletions
|
@ -58,9 +58,13 @@ class Interface(PrintError):
|
|||
@util.aiosafe
|
||||
async def run(self):
|
||||
self.host, self.port, self.protocol = self.server.split(':')
|
||||
async with aiorpcx.ClientSession(self.host, self.port) as session:
|
||||
sslc = ssl.SSLContext(ssl.PROTOCOL_TLS) if self.protocol == 's' else None
|
||||
async with aiorpcx.ClientSession(self.host, self.port, ssl=sslc) as session:
|
||||
ver = await session.send_request('server.version', [ELECTRUM_VERSION, PROTOCOL_VERSION])
|
||||
print(ver)
|
||||
while True:
|
||||
print("sleeping")
|
||||
await asyncio.sleep(1)
|
||||
|
||||
def __init__(self, server):
|
||||
self.exception = None
|
||||
|
|
Loading…
Add table
Reference in a new issue