AV-98-fork

A fork of https://tildegit.org/solderpunk/AV-98
Log (Feed) | Files | Refs (Tags) | README | LICENSE

commit d8ef677ab15996e013ec71615c8a184ef558ded9
parent cbb7b3fd6c20b696b19122837a5c73c431f73e47
Author: Solderpunk <solderpunk@sdf.org>
Date:   Sun, 10 May 2020 14:26:47 +0200

Make sure supplied filenames exist.

Diffstat:
Mav98.py | 16++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/av98.py b/av98.py @@ -715,9 +715,21 @@ Slow internet connection? Use 'set timeout' to be more patient.""") self._deactivate_client_cert() else: print("Loading client certificate file, in PEM format (blank line to cancel)") - certfile = input("Certfile path: ") + certfile = input("Certfile path: ").strip() + if not certfile: + print("Aborting.") + return + elif not os.path.exists(certfile): + print("Certificate file {} does not exist.".format(certfile)) + return print("Loading private key file, in PEM format (blank line to cancel)") - keyfile = input("Keyfile path: ") + keyfile = input("Keyfile path: ").strip() + if not keyfile: + print("Aborting.") + return + elif not os.path.exists(keyfile): + print("Private key file {} does not exist.".format(keyfile)) + return self._activate_client_cert(certfile, keyfile) @restricted