diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2019-12-18 11:47:42 +0100 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2019-12-18 11:47:42 +0100 |
commit | 7dbe1ca370e4e2f5a8b53967af0e3f57966897e9 (patch) | |
tree | cfb317532a37d326301435fd91feaccc7aee6254 | |
parent | 7b7a7293ecca6a81822a85119b19d3c47e6da0bc (diff) | |
download | dlp_check_version_PyPI-7dbe1ca370e4e2f5a8b53967af0e3f57966897e9.tar.gz |
Don't verify SSL, it is just not worthy.
-rwxr-xr-x | dlpcvp.py | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -5,6 +5,7 @@ import json import logging import os.path as osp import sqlite3 +import ssl import sys import urllib.request import xml.etree.ElementTree as ET @@ -39,8 +40,10 @@ user = config[OBS_base]['user'] passw = config[OBS_base]['pass'] password_mgr.add_password(OBS_realm, OBS_base, user, passw) -handler = urllib.request.HTTPBasicAuthHandler(password_mgr) -opener = urllib.request.build_opener(handler) +auth_handler = urllib.request.HTTPBasicAuthHandler(password_mgr) +ssl_handler = urllib.request.HTTPSHandler( + context=ssl._create_unverified_context()) +opener = urllib.request.build_opener(auth_handler, ssl_handler) urllib.request.install_opener(opener) TB_EXISTS = """SELECT name FROM sqlite_master |