Merge pull request #116 from JoakimSoderberg/wsdump_nossl_verification

Enable turning off SSL verification in wsdump.py
This commit is contained in:
liris
2014-10-14 08:36:35 +09:00

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():