aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2019-12-18 11:47:42 +0100
committerMatěj Cepl <mcepl@cepl.eu>2019-12-18 11:47:42 +0100
commit7dbe1ca370e4e2f5a8b53967af0e3f57966897e9 (patch)
treecfb317532a37d326301435fd91feaccc7aee6254
parent7b7a7293ecca6a81822a85119b19d3c47e6da0bc (diff)
downloaddlp_check_version_PyPI-7dbe1ca370e4e2f5a8b53967af0e3f57966897e9.tar.gz
Don't verify SSL, it is just not worthy.
-rwxr-xr-xdlpcvp.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/dlpcvp.py b/dlpcvp.py
index 32702eb..93734f8 100755
--- a/dlpcvp.py
+++ b/dlpcvp.py
@@ -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