forked from solderpunk/AV-98
Make the new --download option play nicely with --tls_cert and --tls_key.
This commit is contained in:
parent
203ffaea90
commit
3abf44d18c
12
av98.py
12
av98.py
|
@ -1413,6 +1413,13 @@ def main():
|
||||||
# Instantiate client
|
# Instantiate client
|
||||||
gc = GeminiClient(args.restricted)
|
gc = GeminiClient(args.restricted)
|
||||||
|
|
||||||
|
# Activate client certs now in case they are needed for --download below
|
||||||
|
if args.tls_cert and args.tls_key:
|
||||||
|
gc.client_cert_manager._activate_client_cert(args.tls_cert, args.tls_key)
|
||||||
|
for url in args.url:
|
||||||
|
gi = GeminiItem(url)
|
||||||
|
gc.client_cert_manager.active_cert_domains.append(gi.host)
|
||||||
|
|
||||||
# Handle --download
|
# Handle --download
|
||||||
if args.dl:
|
if args.dl:
|
||||||
gc.onecmd("set debug True")
|
gc.onecmd("set debug True")
|
||||||
|
@ -1455,10 +1462,7 @@ def main():
|
||||||
print("Restricted mode engaged!")
|
print("Restricted mode engaged!")
|
||||||
print("Enjoy your patrol through Geminispace...")
|
print("Enjoy your patrol through Geminispace...")
|
||||||
|
|
||||||
# Act on args
|
# Add commands to the queue based on command line arguments
|
||||||
if args.tls_cert:
|
|
||||||
# If tls_key is None, python will attempt to load the key from tls_cert.
|
|
||||||
gc.client_cert_manager._activate_client_cert(args.tls_cert, args.tls_key)
|
|
||||||
if args.bookmarks:
|
if args.bookmarks:
|
||||||
gc.cmdqueue.append("bookmarks")
|
gc.cmdqueue.append("bookmarks")
|
||||||
elif args.url:
|
elif args.url:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user