Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding option to disable SSL verification #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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