Enable turning off SSL verification in wsdump.py
This commit is contained in:
@@ -33,6 +33,8 @@ def parse_args():
|
|||||||
dest="verbose",
|
dest="verbose",
|
||||||
help="set verbose mode. If set to 1, show opcode. "
|
help="set verbose mode. If set to 1, show opcode. "
|
||||||
"If set to 2, enable to trace websocket module")
|
"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()
|
return parser.parse_args()
|
||||||
|
|
||||||
@@ -64,7 +66,10 @@ def main():
|
|||||||
console = InteractiveConsole()
|
console = InteractiveConsole()
|
||||||
if args.verbose > 1:
|
if args.verbose > 1:
|
||||||
websocket.enableTrace(True)
|
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")
|
print("Press Ctrl+C to quit")
|
||||||
|
|
||||||
def recv():
|
def recv():
|
||||||
|
Reference in New Issue
Block a user