Skip to content

Commit

Permalink
Fix for truenas#22
Browse files Browse the repository at this point in the history
Adding option to disable SSL verification
  • Loading branch information
monitorjbl committed Dec 21, 2024
1 parent 3576b3c commit ea90aae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion truenas_api_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit ea90aae

Please sign in to comment.