mirror of
https://github.com/element-hq/synapse.git
synced 2024-12-14 11:57:44 +00:00
Add missing type hints to InsecureInterceptableContextFactory. (#15164)
This commit is contained in:
parent
e746f80b4f
commit
c369d82df0
3 changed files with 4 additions and 5 deletions
1
changelog.d/15164.misc
Normal file
1
changelog.d/15164.misc
Normal file
|
@ -0,0 +1 @@
|
|||
Improve type hints.
|
3
mypy.ini
3
mypy.ini
|
@ -36,9 +36,6 @@ exclude = (?x)
|
|||
[mypy-synapse.federation.transport.client]
|
||||
disallow_untyped_defs = False
|
||||
|
||||
[mypy-synapse.http.client]
|
||||
disallow_untyped_defs = False
|
||||
|
||||
[mypy-synapse.http.matrixfederationclient]
|
||||
disallow_untyped_defs = False
|
||||
|
||||
|
|
|
@ -44,6 +44,7 @@ from twisted.internet.interfaces import (
|
|||
IAddress,
|
||||
IDelayedCall,
|
||||
IHostResolution,
|
||||
IOpenSSLContextFactory,
|
||||
IReactorCore,
|
||||
IReactorPluggableNameResolver,
|
||||
IReactorTime,
|
||||
|
@ -958,8 +959,8 @@ class InsecureInterceptableContextFactory(ssl.ContextFactory):
|
|||
self._context = SSL.Context(SSL.SSLv23_METHOD)
|
||||
self._context.set_verify(VERIFY_NONE, lambda *_: False)
|
||||
|
||||
def getContext(self, hostname=None, port=None):
|
||||
def getContext(self) -> SSL.Context:
|
||||
return self._context
|
||||
|
||||
def creatorForNetloc(self, hostname: bytes, port: int):
|
||||
def creatorForNetloc(self, hostname: bytes, port: int) -> IOpenSSLContextFactory:
|
||||
return self
|
||||
|
|
Loading…
Reference in a new issue