Offer to reload previously used certificates for domains visited earlier.

This commit is contained in:
Solderpunk 2020-05-10 14:19:12 +02:00
parent d04c472600
commit cbb7b3fd6c
1 changed files with 10 additions and 0 deletions

10
av98.py
View File

@ -271,6 +271,16 @@ class GeminiClient(cmd.Cmd):
else:
print("Deactivating certificate.")
self._deactivate_client_cert()
# Suggest reactivating previous certs
if not self.client_certs["active"] and gi.host in self.client_certs:
print("PRIVACY ALERT: Reactivate previously used client cert for {}?".format(gi.host))
resp = input("Y/N? ")
if resp.strip().lower() in ("y", "yes"):
self._activate_client_cert(self.client_certs[gi.host])
else:
print("Remaining unidentified.")
self.client_certs.pop(gi.host)
# Do everything which touches the network in one block,
# so we only need to catch exceptions once
try: