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

Force TLS certificate verification in registration script. #16530

Merged

Conversation

dkasak
Copy link
Member

@dkasak dkasak commented Oct 20, 2023

Rationale: 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.

Pull Request Checklist

  • Pull request is based on the develop branch
  • Pull request includes a changelog file. The entry should:
    • Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from EventStore to EventWorkerStore.".
    • Use markdown where necessary, mostly for code blocks.
    • End with either a period (.) or an exclamation mark (!).
    • Start with a capital letter.
    • Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
  • Pull request includes a sign off
  • Code style is correct
    (run the linters)

Rationale: 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.

Signed-off-by: Denis Kasak <[email protected]>
@dkasak dkasak requested a review from a team as a code owner October 20, 2023 14:46
Copy link
Member

@clokep clokep Oct 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the common case of running this locally ensures you don't use TLS, see:

if listener.get("type") != "http" or listener.get("tls", False):
continue

# TODO: consider bind_addresses
return f"http://localhost:{listener['port']}"

@clokep clokep requested a review from a team October 20, 2023 16:16
Copy link
Contributor

@DMRobertson DMRobertson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable to me!

@clokep clokep merged commit 3a0aa6f into matrix-org:develop Oct 23, 2023
38 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants