diff --git a/wig/classes/request2.py b/wig/classes/request2.py index 4dff657..1ad7623 100644 --- a/wig/classes/request2.py +++ b/wig/classes/request2.py @@ -1,6 +1,7 @@ import concurrent.futures import hashlib import re +import ssl import string import random import urllib.request @@ -217,6 +218,7 @@ def __init__(self, options, data): self.threads = options['threads'] self.proxy = options['proxy'] self.user_agent = options['user_agent'] + self.insecure = options['insecure'] self.data = data self.cache = data['cache'] @@ -242,6 +244,12 @@ def _create_fetcher(self, redirect_handler=True): if redirect_handler: args.append(RedirectHandler) + + if self.insecure == True: + ctx = ssl.create_default_context() + ctx.check_hostname = False + ctx.verify_mode = ssl.CERT_NONE + args.append(urllib.request.HTTPSHandler(context=ctx)) opener = urllib.request.build_opener(*args) opener.addheaders = [('User-agent', self.user_agent)] @@ -353,4 +361,4 @@ def run(self, run_type=None, fp_lists=[]): for future in concurrent.futures.as_completed(future_list): self.requested.put(future.result()) - return self.requested \ No newline at end of file + return self.requested diff --git a/wig/wig.py b/wig/wig.py index 2601cce..e42d640 100755 --- a/wig/wig.py +++ b/wig/wig.py @@ -69,6 +69,7 @@ def __init__(self, args): 'user_agent': args.user_agent, 'proxy': args.proxy, 'verbosity': args.verbosity, + 'insecure': args.insecure, 'threads': 10, 'batch_size': 20, 'run_all': args.run_all, @@ -327,6 +328,9 @@ def parse_args(url=None): parser.add_argument('--verbosity', '-v', action='count', default=0, help='Increase verbosity. Use multiple times for more info') + parser.add_argument('--insecure', '-i', action='store_true', dest='insecure', default=False, + help='Do not verify encrypted connections') + parser.add_argument('--proxy', dest='proxy', default=None, help='Tunnel through a proxy (format: localhost:8080)')