]> TLD Linux GIT Repositories - tld-builder.git/commitdiff
- disable SSL certificate validation globally to allow self-signed certs
authorMarcin Krol <hawk@tld-linux.org>
Thu, 28 Jul 2016 16:06:02 +0000 (16:06 +0000)
committerMarcin Krol <hawk@tld-linux.org>
Thu, 28 Jul 2016 16:06:02 +0000 (16:06 +0000)
TLD_Builder/config.py

index 663862e5d1bb4fc4e883537a77badbf99753501a..2e86325f014ef6454a5a848694443fd20b9e52bb 100644 (file)
@@ -9,6 +9,7 @@ import path
 import log
 import status
 
+import ssl
 
 syslog_facilities = {
     'kern': syslog.LOG_KERN,
@@ -122,6 +123,12 @@ class Builder_Conf:
 config = Builder_Conf()
 
 def init_conf(builder=None):
+    try:
+       _create_unverified_https_context = ssl._create_unverified_context
+    except AttributeError:
+       pass
+    else:
+       ssl._create_default_https_context = _create_unverified_https_context
     os.environ['LC_ALL'] = "C"
     status.push("reading builder config")
     log.builder = builder