Functions
create_tls_context
1
ssl.SSLContext
▼
Build an ``ssl.SSLContext`` from server configuration.
create_tls_context
1
ssl.SSLContext
▼
def create_tls_context(config: ServerConfig) -> ssl.SSLContext
Parameters
| Name | Type | Description |
|---|---|---|
config |
ServerConfig |
Server configuration with |
Returns
ssl.SSLContext
_build_alpn_protocols
1
list[str]
▼
Return the ALPN protocol list based on available optional deps.
If HTTP/2 is e…
_build_alpn_protocols
1
list[str]
▼
def _build_alpn_protocols(*, http2_enabled: bool = True) -> list[str]
Return the ALPN protocol list based on available optional deps.
If HTTP/2 is enabled and h2 is installed, advertise h2 first
(preferred), thenhttp/1.1as fallback. Otherwise advertise only
http/1.1so operators can force H1 at the origin.
Parameters
| Name | Type | Description |
|---|---|---|
http2_enabled |
bool |
Default:True
|
Returns
list[str]
is_tls_configured
1
bool
▼
Return True if TLS is configured in the server config.
is_tls_configured
1
bool
▼
def is_tls_configured(config: ServerConfig) -> bool
Parameters
| Name | Type | Description |
|---|---|---|
config |
ServerConfig |
Returns
bool