summary refs log tree commit diff
path: root/register_new_matrix_user
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-04-17 15:16:27 +0100
committerErik Johnston <erik@matrix.org>2015-04-17 15:16:27 +0100
commit231498ac45d3a3ae784a7712ed4085aa42d6dd0a (patch)
treed8e95d7f4cf7d16e0b51b114de9af69284630412 /register_new_matrix_user
parentMerge pull request #119 from matrix-org/hotfixes-v0.8.1-r3 (diff)
parentThe new parameter to urlopen is "context" not "ctx" (diff)
downloadsynapse-231498ac45d3a3ae784a7712ed4085aa42d6dd0a.tar.xz
Merge pull request #124 from matrix-org/hotfixes-v0.8.1-r4 v0.8.1-r4
Hotfixes v0.8.1-r4
Diffstat (limited to 'register_new_matrix_user')
-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..4a520bdb5d 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, context=ssl.SSLContext(ssl.PROTOCOL_SSLv23))
+        else:
+            f = urllib2.urlopen(req)
         f.read()
         f.close()
         print "Success."