Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Force TLS certificate verification in registration script. (#16530)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dkasak authored Oct 23, 2023
1 parent 12ca87f commit 3a0aa6f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/16530.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Force TLS certificate verification in user registration script.
4 changes: 2 additions & 2 deletions synapse/_scripts/register_new_matrix_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 3a0aa6f

Please sign in to comment.