Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timo Ley
synapse
Commits
e2dfb922
Commit
e2dfb922
authored
5 years ago
by
Richard van der Hoff
Browse files
Options
Downloads
Patches
Plain Diff
Validate federation server TLS certificates by default.
parent
14f13bab
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
changelog.d/5359.feature
+1
-0
1 addition, 0 deletions
changelog.d/5359.feature
synapse/config/tls.py
+5
-5
5 additions, 5 deletions
synapse/config/tls.py
tests/http/federation/test_matrix_federation_agent.py
+9
-3
9 additions, 3 deletions
tests/http/federation/test_matrix_federation_agent.py
with
15 additions
and
8 deletions
changelog.d/5359.feature
0 → 100644
+
1
−
0
View file @
e2dfb922
Validate federation server TLS certificates by default (implements [MSC1711](https
:
//github.com/matrix-org/matrix-doc/blob/master/proposals/1711-x509-for-federation.md)).
This diff is collapsed.
Click to expand it.
synapse/config/tls.py
+
5
−
5
View file @
e2dfb922
...
...
@@ -74,7 +74,7 @@ class TlsConfig(Config):
# Whether to verify certificates on outbound federation traffic
self
.
federation_verify_certificates
=
config
.
get
(
"
federation_verify_certificates
"
,
Fals
e
,
"
federation_verify_certificates
"
,
Tru
e
,
)
# Whitelist of domains to not verify certificates for
...
...
@@ -241,12 +241,12 @@ class TlsConfig(Config):
#
#tls_private_key_path:
"
%(tls_private_key_path)s
"
# Whether to verify TLS certificates
when sending
federation
traffic
.
# Whether to verify TLS
server
certificates
for outbound
federation
requests
.
#
#
This currently defaults to `false`, however this will change in
#
Synapse 1.0 when valid federation certificates will be required
.
#
Defaults to `true`. To disable certificate verification, uncomment the
#
following line
.
#
#federation_verify_certificates:
tru
e
#federation_verify_certificates:
fals
e
# Skip federation certificate verification on the following whitelist
# of domains.
...
...
This diff is collapsed.
Click to expand it.
tests/http/federation/test_matrix_federation_agent.py
+
9
−
3
View file @
e2dfb922
...
...
@@ -27,6 +27,7 @@ from twisted.web.http import HTTPChannel
from
twisted.web.http_headers
import
Headers
from
twisted.web.iweb
import
IPolicyForHTTPS
from
synapse.config.homeserver
import
HomeServerConfig
from
synapse.crypto.context_factory
import
ClientTLSOptionsFactory
from
synapse.http.federation.matrix_federation_agent
import
(
MatrixFederationAgent
,
...
...
@@ -52,11 +53,16 @@ class MatrixFederationAgentTests(TestCase):
self
.
well_known_cache
=
TTLCache
(
"
test_cache
"
,
timer
=
self
.
reactor
.
seconds
)
# for now, we disable cert verification for the test, since the cert we
# present will not be trusted. We should do better here, though.
config_dict
=
default_config
(
"
test
"
,
parse
=
False
)
config_dict
[
"
federation_verify_certificates
"
]
=
False
config
=
HomeServerConfig
()
config
.
parse_config_dict
(
config_dict
)
self
.
agent
=
MatrixFederationAgent
(
reactor
=
self
.
reactor
,
tls_client_options_factory
=
ClientTLSOptionsFactory
(
default_config
(
"
test
"
,
parse
=
True
)
),
tls_client_options_factory
=
ClientTLSOptionsFactory
(
config
),
_well_known_tls_policy
=
TrustingTLSPolicyForHTTPS
(),
_srv_resolver
=
self
.
mock_resolver
,
_well_known_cache
=
self
.
well_known_cache
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment