Skip to content

Commit

Permalink
Add web_ssl_context to allow internal web server to support https (#69)
Browse files Browse the repository at this point in the history
* Add web_ssl_context to allow internal web server to support https

* updating version to 0.4.1

* Add web_ssl_context to allow internal web server to support https

Co-authored-by: Vikram Patki 24489 <vpatki@wayfair.com>
  • Loading branch information
bobh66 and patkivikram authored Jan 4, 2021
1 parent 9a42a58 commit fcb6b18
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions faust/types/settings/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ def __init__(
web_host: str = None,
web_in_thread: bool = None,
web_port: int = None,
web_ssl_context: ssl.SSLContext = None,
web_transport: URLArg = None,
# Worker settings:
worker_redirect_stdouts: bool = None,
Expand Down Expand Up @@ -1797,6 +1798,17 @@ def web_port(self) -> int:
not by passing it as a keyword argument to :class:`app`.
"""

@sections.WebServer.setting(
params.SSLContext,
version_introduced="0.5.0",
default=None,
)
def web_ssl_context(self) -> ssl.SSLContext:
"""Web server SSL configuration.
See :setting:`credentials`.
"""

@sections.WebServer.setting(
params.URL,
version_introduced="1.2",
Expand Down
1 change: 1 addition & 0 deletions faust/web/drivers/aiohttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ def _new_transport_tcp(self) -> BaseSite:
self._runner,
self.app.conf.web_bind,
self.app.conf.web_port,
ssl_context=self.app.conf.web_ssl_context,
)

def _new_transport_unix(self) -> BaseSite:
Expand Down

0 comments on commit fcb6b18

Please sign in to comment.