summary refs log tree commit diff
diff options
context:
space:
mode:
authorDenis Kasak <dkasak@termina.org.uk>2023-10-23 11:38:51 +0000
committerGitHub <noreply@github.com>2023-10-23 07:38:51 -0400
commit3a0aa6fe76c43b09a0e13785894df2a285396c10 (patch)
tree12bc9cdec02b0db68f8e348d65fc18cfedad524b
parentRemove the last reference to event_txn_id. (#16521) (diff)
downloadsynapse-3a0aa6fe76c43b09a0e13785894df2a285396c10.tar.xz
Force TLS certificate verification in registration script. (#16530)
If using the script remotely, there's no particularly convincing reason
to disable certificate verification, as this makes the connection
interceptible.

If on the other hand, the script is used locally (the most common use
case), you can simply target the HTTP listener and avoid TLS altogether.
This is what the script already attempts to do if passed a homeserver
configuration YAML file.
-rw-r--r--changelog.d/16530.bugfix1
-rw-r--r--synapse/_scripts/register_new_matrix_user.py4
2 files changed, 3 insertions, 2 deletions
diff --git a/changelog.d/16530.bugfix b/changelog.d/16530.bugfix
new file mode 100644
index 0000000000..503ea0af20
--- /dev/null
+++ b/changelog.d/16530.bugfix
@@ -0,0 +1 @@
+Force TLS certificate verification in user registration script.
diff --git a/synapse/_scripts/register_new_matrix_user.py b/synapse/_scripts/register_new_matrix_user.py
index 19ca399d44..9293808640 100644
--- a/synapse/_scripts/register_new_matrix_user.py
+++ b/synapse/_scripts/register_new_matrix_user.py
@@ -50,7 +50,7 @@ def request_registration(
     url = "%s/_synapse/admin/v1/register" % (server_location.rstrip("/"),)
 
     # Get the nonce
-    r = requests.get(url, verify=False)
+    r = requests.get(url)
 
     if r.status_code != 200:
         _print("ERROR! Received %d %s" % (r.status_code, r.reason))
@@ -88,7 +88,7 @@ def request_registration(
     }
 
     _print("Sending registration request...")
-    r = requests.post(url, json=data, verify=False)
+    r = requests.post(url, json=data)
 
     if r.status_code != 200:
         _print("ERROR! Received %d %s" % (r.status_code, r.reason))