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
b3097396
Commit
b3097396
authored
6 years ago
by
Richard van der Hoff
Browse files
Options
Downloads
Patches
Plain Diff
Set SNI to the server_name, not whatever was in the SRV record
Fixes #3843
parent
286d6930
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/http/endpoint.py
+10
-3
10 additions, 3 deletions
synapse/http/endpoint.py
with
10 additions
and
3 deletions
synapse/http/endpoint.py
+
10
−
3
View file @
b3097396
...
@@ -108,7 +108,7 @@ def matrix_federation_endpoint(reactor, destination, tls_client_options_factory=
...
@@ -108,7 +108,7 @@ def matrix_federation_endpoint(reactor, destination, tls_client_options_factory=
Args:
Args:
reactor: Twisted reactor.
reactor: Twisted reactor.
destination (
bytes
): The name of the server to connect to.
destination (
unicode
): The name of the server to connect to.
tls_client_options_factory
tls_client_options_factory
(synapse.crypto.context_factory.ClientTLSOptionsFactory):
(synapse.crypto.context_factory.ClientTLSOptionsFactory):
Factory which generates TLS options for client connections.
Factory which generates TLS options for client connections.
...
@@ -126,10 +126,17 @@ def matrix_federation_endpoint(reactor, destination, tls_client_options_factory=
...
@@ -126,10 +126,17 @@ def matrix_federation_endpoint(reactor, destination, tls_client_options_factory=
transport_endpoint
=
HostnameEndpoint
transport_endpoint
=
HostnameEndpoint
default_port
=
8008
default_port
=
8008
else
:
else
:
# the SNI string should be the same as the Host header, minus the port.
# as per https://github.com/matrix-org/synapse/issues/2525#issuecomment-336896777,
# the Host header and SNI should therefore be the server_name of the remote
# server.
tls_options
=
tls_client_options_factory
.
get_options
(
domain
)
def
transport_endpoint
(
reactor
,
host
,
port
,
timeout
):
def
transport_endpoint
(
reactor
,
host
,
port
,
timeout
):
return
wrapClientTLS
(
return
wrapClientTLS
(
tls_client_options_factory
.
get_options
(
host
),
tls_options
,
HostnameEndpoint
(
reactor
,
host
,
port
,
timeout
=
timeout
))
HostnameEndpoint
(
reactor
,
host
,
port
,
timeout
=
timeout
),
)
default_port
=
8448
default_port
=
8448
if
port
is
None
:
if
port
is
None
:
...
...
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