mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-23 17:47:31 +00:00
update to aiorpcx 0.18
This commit is contained in:
parent
eaf203dbb5
commit
41f160dd74
2 changed files with 9 additions and 8 deletions
|
@ -5,7 +5,7 @@ protobuf
|
|||
dnspython
|
||||
jsonrpclib-pelix
|
||||
qdarkstyle<3.0
|
||||
aiorpcx>=0.17,<0.18
|
||||
aiorpcx>=0.18,<0.19
|
||||
aiohttp>=3.3.0
|
||||
aiohttp_socks
|
||||
certifi
|
||||
|
|
|
@ -39,6 +39,7 @@ import aiorpcx
|
|||
from aiorpcx import RPCSession, Notification, NetAddress
|
||||
from aiorpcx.curio import timeout_after, TaskTimeout
|
||||
from aiorpcx.jsonrpc import JSONRPC
|
||||
from aiorpcx.rawsocket import RSClient
|
||||
import certifi
|
||||
|
||||
from .util import ignore_exceptions, log_exceptions, bfh, SilentTaskGroup
|
||||
|
@ -172,7 +173,7 @@ class ErrorGettingSSLCertFromServer(Exception): pass
|
|||
class ConnectError(Exception): pass
|
||||
|
||||
|
||||
class _Connector(aiorpcx.Connector):
|
||||
class _RSClient(RSClient):
|
||||
async def create_connection(self):
|
||||
try:
|
||||
return await super().create_connection()
|
||||
|
@ -392,9 +393,9 @@ class Interface(Logger):
|
|||
async def get_certificate(self):
|
||||
sslc = ssl.SSLContext()
|
||||
try:
|
||||
async with _Connector(RPCSession,
|
||||
host=self.host, port=self.port,
|
||||
ssl=sslc, proxy=self.proxy) as session:
|
||||
async with _RSClient(session_factory=RPCSession,
|
||||
host=self.host, port=self.port,
|
||||
ssl=sslc, proxy=self.proxy) as session:
|
||||
return session.transport._ssl_protocol._sslpipe._sslobj.getpeercert(True)
|
||||
except ValueError:
|
||||
return None
|
||||
|
@ -430,9 +431,9 @@ class Interface(Logger):
|
|||
return self.network.default_server == self.server
|
||||
|
||||
async def open_session(self, sslc, exit_early=False):
|
||||
async with _Connector(NotificationSession,
|
||||
host=self.host, port=self.port,
|
||||
ssl=sslc, proxy=self.proxy) as session:
|
||||
async with _RSClient(session_factory=NotificationSession,
|
||||
host=self.host, port=self.port,
|
||||
ssl=sslc, proxy=self.proxy) as session:
|
||||
self.session = session # type: NotificationSession
|
||||
self.session.interface = self
|
||||
self.session.set_default_timeout(self.network.get_network_timeout_seconds(NetworkTimeout.Generic))
|
||||
|
|
Loading…
Add table
Reference in a new issue