[Kimchi-devel] [PATCH V3 3/4] Disable SSL certificate validation in tests.

Julien Goodwin jgoodwin at studio442.com.au
Tue Mar 17 09:37:41 UTC 2015


It appears that python (at least in debian) now validates SSL
certificats by default, add an sslcontext to explicitly disable this.

Signed-off-by: Julien Goodwin <jgoodwin at studio442.com.au>
---
 tests/utils.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tests/utils.py b/tests/utils.py
index 2a8929f..412487b 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -25,6 +25,7 @@ import httplib
 import json
 import os
 import socket
+import ssl
 import sys
 import time
 import threading
@@ -148,7 +149,9 @@ def _request(conn, path, data, method, headers):
 
 
 def request(host, port, path, data=None, method='GET', headers=None):
-    conn = httplib.HTTPSConnection(host, port)
+    context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+    context.verify_mode = ssl.CERT_NONE
+    conn = httplib.HTTPSConnection(host, port, context=context)
     return _request(conn, path, data, method, headers)
 
 
-- 
2.1.4




More information about the Kimchi-devel mailing list