commit 969d3c1b18b584a628e94034fdc6f867fe5329d3
parent e20ac17107a19446237ce179eb33c630f5fc3cf0
Author: Solderpunk <solderpunk@sdf.org>
Date: Sun, 30 Aug 2020 16:50:52 +0200
Permit use of ~ in key/cert files.
Diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/av98.py b/av98.py
@@ -912,12 +912,12 @@ Slow internet connection? Use 'set timeout' to be more patient.""")
format.
"""
print("Loading client certificate file, in PEM format (blank line to cancel)")
- print("Do not use `~` to represent your home directory.")
certfile = input("Certfile path: ").strip()
if not certfile:
print("Aborting.")
return
- elif not os.path.isfile(certfile):
+ certfile = os.path.expanduser(certfile)
+ if not os.path.isfile(certfile):
print("Certificate file {} does not exist.".format(certfile))
return
print("Loading private key file, in PEM format (blank line to cancel)")
@@ -925,7 +925,8 @@ Slow internet connection? Use 'set timeout' to be more patient.""")
if not keyfile:
print("Aborting.")
return
- elif not os.path.isfile(keyfile):
+ keyfile = os.path.expanduser(keyfile)
+ if not os.path.isfile(keyfile):
print("Private key file {} does not exist.".format(keyfile))
return
self._activate_client_cert(certfile, keyfile)