Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Add missing type hints to InsecureInterceptableContextFactory. (#15164)
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep committed Feb 28, 2023
1 parent e746f80 commit c369d82
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions changelog.d/15164.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve type hints.
3 changes: 0 additions & 3 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 3 additions & 2 deletions synapse/http/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
IAddress,
IDelayedCall,
IHostResolution,
IOpenSSLContextFactory,
IReactorCore,
IReactorPluggableNameResolver,
IReactorTime,
Expand Down Expand Up @@ -958,8 +959,8 @@ def __init__(self) -> None:
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

0 comments on commit c369d82

Please sign in to comment.