From ea90aaeb5d53c954bb3984520421d8ed66252719 Mon Sep 17 00:00:00 2001 From: Taylor Jones Date: Sat, 21 Dec 2024 16:01:36 -0500 Subject: [PATCH] Fix for #22 Adding option to disable SSL verification --- truenas_api_client/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/truenas_api_client/__init__.py b/truenas_api_client/__init__.py index ccd59b1..ea733d6 100644 --- a/truenas_api_client/__init__.py +++ b/truenas_api_client/__init__.py @@ -882,6 +882,7 @@ def main(): parser.add_argument('-P', '--password') parser.add_argument('-K', '--api-key') parser.add_argument('-t', '--timeout', type=int) + parser.add_argument('-k', '--insecure', action='store_true', help='Disable SSL verification') subparsers = parser.add_subparsers(help='sub-command help', dest='name') iparser = subparsers.add_parser('call', help='Call method') @@ -915,7 +916,7 @@ def from_json(args): if args.name == 'call': try: - with Client(uri=args.uri) as c: + with Client(uri=args.uri, verify_ssl=(not args.insecure)) as c: try: if args.username and args.password: if not c.call('auth.login', args.username, args.password):