From b4510969164a88788d23340d70115b5f4f02e7b1 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 11 May 2024 22:15:57 -0500 Subject: [PATCH] notify if failed to load bundle --- scripts/auto_tls.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/auto_tls.py b/scripts/auto_tls.py index 9d0826c..db51b90 100644 --- a/scripts/auto_tls.py +++ b/scripts/auto_tls.py @@ -63,8 +63,13 @@ else: print("TLS components missing or invalid.") raise e +success_msg = 'Certificate trust store ready' if cmd_opts.autotls_bundle is not None: - os.environ['REQUESTS_CA_BUNDLE'] = cmd_opts.autotls_bundle + if not os.path.exists(cmd_opts.autotls_bundle): + print(f"could not open bundle file '{cmd_opts.autotls_bundle}'") + else: + os.environ['REQUESTS_CA_BUNDLE'] = cmd_opts.autotls_bundle + print(success_msg) else: setup_bundle(cmd_opts.tls_certfile) -print('Certificate trust store ready') + print(success_msg)