Enable turning off SSL verification in wsdump.py

This commit is contained in:
Joakim Söderberg
2014-10-13 09:23:59 +02:00
parent 322687e987
commit ce60ec12e7

View File

@@ -33,6 +33,8 @@ def parse_args():
dest="verbose",
help="set verbose mode. If set to 1, show opcode. "
"If set to 2, enable to trace websocket module")
parser.add_argument("-n", "--nocert", action='store_true',
help="Ignore invalid SSL cert")
return parser.parse_args()
@@ -64,7 +66,10 @@ def main():
console = InteractiveConsole()
if args.verbose > 1:
websocket.enableTrace(True)
ws = websocket.create_connection(args.url)
opts = {}
if (args.nocert):
opts = { "cert_reqs": websocket.ssl.CERT_NONE, "check_hostname": False }
ws = websocket.create_connection(args.url, sslopt=opts)
print("Press Ctrl+C to quit")
def recv():