mirror of
https://github.com/onionshare/onionshare.git
synced 2024-12-29 01:06:16 -05:00
Catch all exceptions when checking for stealth support, not just TypeError, to successfully identity old versions of stem
This commit is contained in:
parent
eff0d3729a
commit
6fdef85878
@ -99,12 +99,16 @@ class Onion(object):
|
|||||||
self.supports_ephemeral = callable(list_ephemeral_hidden_services) and tor_version >= '0.2.7.1'
|
self.supports_ephemeral = callable(list_ephemeral_hidden_services) and tor_version >= '0.2.7.1'
|
||||||
|
|
||||||
# do the versions of stem and tor that I'm using support stealth onion services?
|
# do the versions of stem and tor that I'm using support stealth onion services?
|
||||||
|
if self.stealth:
|
||||||
|
self.check_for_stealth_support()
|
||||||
|
|
||||||
|
def check_for_stealth_support(self):
|
||||||
try:
|
try:
|
||||||
res = self.c.create_ephemeral_hidden_service({1:1}, basic_auth={'onionshare':None}, await_publication=False)
|
res = self.c.create_ephemeral_hidden_service({1:1}, basic_auth={'onionshare':None}, await_publication=False)
|
||||||
tmp_service_id = res.content()[0][2].split('=')[1]
|
tmp_service_id = res.content()[0][2].split('=')[1]
|
||||||
self.c.remove_ephemeral_hidden_service(tmp_service_id)
|
self.c.remove_ephemeral_hidden_service(tmp_service_id)
|
||||||
self.supports_stealth = True
|
self.supports_stealth = True
|
||||||
except TypeError:
|
except:
|
||||||
# ephemeral stealth onion services are not supported
|
# ephemeral stealth onion services are not supported
|
||||||
self.supports_stealth = False
|
self.supports_stealth = False
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user