Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verify federation certs #133

Merged
merged 6 commits into from
Mar 21, 2019
Merged

Verify federation certs #133

merged 6 commits into from
Mar 21, 2019

Conversation

anoadragon453
Copy link
Member

@anoadragon453 anoadragon453 commented Mar 20, 2019

Closes #95

Should only be merged once we've released Synapse 1.0 Behind an option flag now so nvm.

Currently not tested.

@anoadragon453 anoadragon453 requested a review from a team March 20, 2019 11:50
Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

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

so I'd like to see this behaviour be driven by a config option, so that we can get the code landed without breaking things.

We might also end up needing a whitelist for domains that can be trusted without a valid cert, or accepting certs signed by a given CA, but we can probably punt them for sydent for now.

@anoadragon453
Copy link
Member Author

Now uses a config option with the default to not verify federation certificates. We can change this in the future.

@richvdh
Copy link
Member

richvdh commented Mar 21, 2019

Should only be merged once we've released Synapse 1.0

Notwithstanding the business of whether it should be beside a config flag, this is incorrect. There is no need to wait for Synapse 1.0: we can enable this check as soon as we take a view that most of the ecosystem has fixed their certificates. For sure that is one of the requirements of a synapse 1.0 release, but there may be other reasons that Synapse 1.0 is not released.

In short: a synapse 1.0 release is sufficient but not necessary.

# We don't use config options yet
self._options = ssl.CertificateOptions(verify=False)
def __init__(self, config):
self._options = ssl.CertificateOptions(verify=config.get("http", "federation.verifycerts"))
Copy link
Member

Choose a reason for hiding this comment

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

Are you sure this does what you want? "False" is a non-empty string...

(hint: https://docs.python.org/2.7/library/configparser.html#ConfigParser.RawConfigParser.getboolean)

sydent/sydent.py Outdated
@@ -77,6 +77,7 @@
'replication.https.bind_address': '::',
'replication.https.port': '4434',
'obey_x_forwarded_for': 'False',
'federation.verifycerts': 'False',
Copy link
Member

Choose a reason for hiding this comment

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

I think there's a strong argument for setting this to True by default now; I'd prefer not to have to remember to revisit this. I don't think we have anyone pulling sydent updates regularly, and we're already at 60% and rising. Anyone who does update sydent (including matrix.org/vector.im/dinsic) can use the config setting to disable the check until they are ready to enforce it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Got it, setting to True then 👍

Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

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

lgtm!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants