interface: follow-up 6ec1578a90
This commit is contained in:
@@ -305,7 +305,7 @@ class Interface(Logger):
|
|||||||
if not self._is_saved_ssl_cert_available():
|
if not self._is_saved_ssl_cert_available():
|
||||||
try:
|
try:
|
||||||
await self._try_saving_ssl_cert_for_first_time(ca_sslc)
|
await self._try_saving_ssl_cert_for_first_time(ca_sslc)
|
||||||
except (OSError, aiorpcx.socks.SOCKSError) as e:
|
except (OSError, ConnectError, aiorpcx.socks.SOCKSError) as e:
|
||||||
raise ErrorGettingSSLCertFromServer(e) from e
|
raise ErrorGettingSSLCertFromServer(e) from e
|
||||||
# now we have a file saved in our certificate store
|
# now we have a file saved in our certificate store
|
||||||
siz = os.stat(self.cert_path).st_size
|
siz = os.stat(self.cert_path).st_size
|
||||||
@@ -389,9 +389,9 @@ class Interface(Logger):
|
|||||||
async def get_certificate(self):
|
async def get_certificate(self):
|
||||||
sslc = ssl.SSLContext()
|
sslc = ssl.SSLContext()
|
||||||
try:
|
try:
|
||||||
async with aiorpcx.Connector(RPCSession,
|
async with _Connector(RPCSession,
|
||||||
host=self.host, port=self.port,
|
host=self.host, port=self.port,
|
||||||
ssl=sslc, proxy=self.proxy) as session:
|
ssl=sslc, proxy=self.proxy) as session:
|
||||||
return session.transport._ssl_protocol._sslpipe._sslobj.getpeercert(True)
|
return session.transport._ssl_protocol._sslpipe._sslobj.getpeercert(True)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
return None
|
return None
|
||||||
|
|||||||
Reference in New Issue
Block a user