Gracefully avoid sending the client_auth_v3 argument to Stem's create_ephemeral_hidden_service() if the version of Stem we're on does not yet support it

This commit is contained in:
Miguel Jacq 2021-05-06 14:35:11 +10:00
parent 80cc1f43e8
commit e4465435fa

View File

@ -663,14 +663,23 @@ class Onion(object):
client_auth_v3_pub_key = None
try:
res = self.c.create_ephemeral_hidden_service(
{80: port},
await_publication=await_publication,
basic_auth=None,
key_type=key_type,
key_content=key_content,
client_auth_v3=client_auth_v3_pub_key,
)
if not self.supports_stealth:
res = self.c.create_ephemeral_hidden_service(
{80: port},
await_publication=await_publication,
basic_auth=None,
key_type=key_type,
key_content=key_content,
)
else:
res = self.c.create_ephemeral_hidden_service(
{80: port},
await_publication=await_publication,
basic_auth=None,
key_type=key_type,
key_content=key_content,
client_auth_v3=client_auth_v3_pub_key,
)
except ProtocolError as e:
print("Tor error: {}".format(e.args[0]))