diff --git a/bin/wsdump.py b/bin/wsdump.py index 14e7b79..51269a7 100755 --- a/bin/wsdump.py +++ b/bin/wsdump.py @@ -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():