Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Commit

Permalink
add option to disable SSL/TLS certificate verification (--insecure)
Browse files Browse the repository at this point in the history
  • Loading branch information
dynasticorpheus committed Mar 7, 2016
1 parent b20c3bb commit 874eacf
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions gigasetelements/gigasetelements.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
parser.add_argument('-i', '--ignore', help='ignore configuration-file at predefined locations', action='store_true', required=False)
parser.add_argument('-j', '--restart', help='automatically restart program in case of a connection error', action='store_true', required=False)
parser.add_argument('-q', '--quiet', help='do not send pushbullet message', action='store_true', required=False)
parser.add_argument('-I', '--insecure', help='disable SSL/TLS certificate verification', action='store_true', required=False)
parser.add_argument('-w', '--warning', help='suppress urllib3 warnings', action='store_true', required=False)
parser.add_argument('-v', '--version', help='show version', action='version', version='%(prog)s version ' + str(_VERSION_))

Expand Down Expand Up @@ -182,11 +183,14 @@ def configure():
global pem
credfromfile = False
authstring = ''
try:
import certifi
pem = certifi.old_where()
except Exception:
pem = True
if args.insecure:
pem = False
else:
try:
import certifi
pem = certifi.old_where()
except Exception:
pem = True
if args.config is None:
locations = ['/opt/etc/gigasetelements-cli.conf', '/usr/local/etc/gigasetelements-cli.conf', '/usr/etc/gigasetelements-cli.conf',
'/etc/gigasetelements-cli.conf', os.path.expanduser('~/.gigasetelements-cli/gigasetelements-cli.conf'),
Expand Down

0 comments on commit 874eacf

Please sign in to comment.