From 39b8d121b4867c667194369f17946be8ebb06e8b Mon Sep 17 00:00:00 2001 From: crupest Date: Sun, 27 Nov 2022 11:43:19 +0800 Subject: Add basic function for checking ssl certs. --- tool/aio.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tool/aio.py') diff --git a/tool/aio.py b/tool/aio.py index 4327e95..9d14e5f 100755 --- a/tool/aio.py +++ b/tool/aio.py @@ -3,6 +3,7 @@ try: import rich import jsonschema + import cryptography except ImportError: print("Some necessary modules can't be imported. Please run `pip install -r requirements.txt` to install them.") exit(1) @@ -512,6 +513,12 @@ if os.path.isdir(data_dir): "Looks like you haven't run certbot to get the init ssl certificates. You may want to run following code to get one:", style="cyan") console.print(certbot_command_gen(domain, "create"), soft_wrap=True, highlight=False) + else: + to_check = Confirm.ask( + "I want to check your ssl certs, but I need to sudo. Do you want me check", console=console, default=False) + if to_check: + get_cert_path(check_domain_is_defined()) + # TODO: Do the check! if not os.path.exists(os.path.join(data_dir, "code-server")): os.mkdir(os.path.join(data_dir, "code-server")) -- cgit v1.2.3