Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
561eebe1
Commit
561eebe1
authored
6 years ago
by
Amber Brown
Browse files
Options
Downloads
Patches
Plain Diff
fix to use makeContext so that we don't need to rebuild the certificateoptions each time
parent
d154f5a0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/crypto/context_factory.py
+6
-8
6 additions, 8 deletions
synapse/crypto/context_factory.py
with
6 additions
and
8 deletions
synapse/crypto/context_factory.py
+
6
−
8
View file @
561eebe1
# Copyright 2014-2016 OpenMarket Ltd
# Copyright 2019 New Vector Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
@@ -11,6 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import
logging
from
zope.interface
import
implementer
...
...
@@ -105,9 +107,7 @@ class ClientTLSOptions(object):
self
.
_hostnameBytes
=
_idnaBytes
(
hostname
)
self
.
_sendSNI
=
True
ctx
.
set_info_callback
(
_tolerateErrors
(
self
.
_identityVerifyingInfoCallback
)
)
ctx
.
set_info_callback
(
_tolerateErrors
(
self
.
_identityVerifyingInfoCallback
))
def
clientConnectionForTLS
(
self
,
tlsProtocol
):
context
=
self
.
_ctx
...
...
@@ -128,10 +128,8 @@ class ClientTLSOptionsFactory(object):
def
__init__
(
self
,
config
):
# We don't use config options yet
pass
self
.
_options
=
CertificateOptions
(
verify
=
False
)
def
get_options
(
self
,
host
):
return
ClientTLSOptions
(
host
,
CertificateOptions
(
verify
=
False
).
getContext
()
)
# Use _makeContext so that we get a fresh OpenSSL CTX each time.
return
ClientTLSOptions
(
host
,
self
.
_options
.
_makeContext
())
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