summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-04-17 13:24:55 +0100
committerErik Johnston <erik@matrix.org>2015-04-17 13:24:55 +0100
commit16dcdedc8a74967d5cafb466cc2f1af04b617458 (patch)
tree8bc93ab819d3c1823a218044d96236d87de45202
parentMerge pull request #119 from matrix-org/hotfixes-v0.8.1-r3 (diff)
downloadsynapse-16dcdedc8a74967d5cafb466cc2f1af04b617458.tar.xz
As of version 2.7.9, urllib2 now checks SSL certs
-rwxr-xr-xregister_new_matrix_user7
1 files changed, 6 insertions, 1 deletions
diff --git a/register_new_matrix_user b/register_new_matrix_user
index daddadc302..974dfd3981 100755
--- a/register_new_matrix_user
+++ b/register_new_matrix_user
@@ -49,7 +49,12 @@ def request_registration(user, password, server_location, shared_secret):
         headers={'Content-Type': 'application/json'}
     )
     try:
-        f = urllib2.urlopen(req)
+        if sys.version_info[:3] >= (2, 7, 9):
+            # As of version 2.7.9, urllib2 now checks SSL certs
+            import ssl
+            f = urllib2.urlopen(req, ctx=ssl.SSLContext(ssl.PROTOCOL_SSLv23))
+        else:
+            f = urllib2.urlopen(req)
         f.read()
         f.close()
         print "Success."