From e49ca957f7c364fe2352f04e10c2529194c322da Mon Sep 17 00:00:00 2001 From: Sven Velt Date: Thu, 18 Feb 2010 13:08:43 +0100 Subject: [PATCH] Added --nossl to HTTP daemons Disable SSL on command line even if it's activated in cfg file. Signed-off-by: Sven Velt --- nagixsc_conf2http.py | 4 ++++ nagixsc_http2nagios.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/nagixsc_conf2http.py b/nagixsc_conf2http.py index d296bff..abeed4e 100755 --- a/nagixsc_conf2http.py +++ b/nagixsc_conf2http.py @@ -22,6 +22,7 @@ from nagixsc import * parser = optparse.OptionParser() parser.add_option('-c', '', dest='cfgfile', help='Config file') +parser.add_option('', '--nossl', action='store_true', dest='nossl', help='Disable SSL (overwrites config file)') parser.set_defaults(cfgfile='conf2http.cfg') @@ -124,6 +125,9 @@ class Conf2HTTPHandler(MyHTTPRequestHandler): def main(): + if options.nossl: + config['ssl'] = False + if config['ssl'] and not os.path.isfile(config['cert']): print 'SSL certificate "%s" not found!' % config['cert'] sys.exit(127) diff --git a/nagixsc_http2nagios.py b/nagixsc_http2nagios.py index b0e6fd2..ad86b65 100755 --- a/nagixsc_http2nagios.py +++ b/nagixsc_http2nagios.py @@ -22,6 +22,7 @@ from nagixsc import * parser = optparse.OptionParser() parser.add_option('-c', '', dest='cfgfile', help='Config file') +parser.add_option('', '--nossl', action='store_true', dest='nossl', help='Disable SSL (overwrites config file)') parser.set_defaults(cfgfile='http2nagios.cfg') @@ -121,6 +122,9 @@ class HTTP2NagiosHandler(MyHTTPRequestHandler): def main(): + if options.nossl: + config['ssl'] = False + if config['ssl'] and not os.path.isfile(config['cert']): print 'SSL certificate "%s" not found!' % config['cert'] sys.exit(127) -- 2.30.2