pub struct TlsServer<F> { /* private fields */ }Expand description
A Warp Server ready to filter requests over TLS.
This type requires the "tls" feature.
Implementations§
Source§impl<F> TlsServer<F>
impl<F> TlsServer<F>
Sourcepub fn key_path(self, path: impl AsRef<Path>) -> TlsServer<F>
pub fn key_path(self, path: impl AsRef<Path>) -> TlsServer<F>
Specify the file path to read the private key.
This function requires the "tls" feature.
Sourcepub fn cert_path(self, path: impl AsRef<Path>) -> TlsServer<F>
pub fn cert_path(self, path: impl AsRef<Path>) -> TlsServer<F>
Specify the file path to read the certificate.
This function requires the "tls" feature.
Sourcepub fn client_auth_optional_path(self, path: impl AsRef<Path>) -> TlsServer<F>
pub fn client_auth_optional_path(self, path: impl AsRef<Path>) -> TlsServer<F>
Specify the file path to read the trust anchor for optional client authentication.
Anonymous and authenticated clients will be accepted. If no trust anchor is provided by any
of the client_auth_ methods, then client authentication is disabled by default.
This function requires the "tls" feature.
Sourcepub fn client_auth_required_path(self, path: impl AsRef<Path>) -> TlsServer<F>
pub fn client_auth_required_path(self, path: impl AsRef<Path>) -> TlsServer<F>
Specify the file path to read the trust anchor for required client authentication.
Only authenticated clients will be accepted. If no trust anchor is provided by any of the
client_auth_ methods, then client authentication is disabled by default.
This function requires the "tls" feature.
Sourcepub fn key(self, key: impl AsRef<[u8]>) -> TlsServer<F>
pub fn key(self, key: impl AsRef<[u8]>) -> TlsServer<F>
Specify the in-memory contents of the private key.
This function requires the "tls" feature.
Sourcepub fn cert(self, cert: impl AsRef<[u8]>) -> TlsServer<F>
pub fn cert(self, cert: impl AsRef<[u8]>) -> TlsServer<F>
Specify the in-memory contents of the certificate.
This function requires the "tls" feature.
Sourcepub fn client_auth_optional(
self,
trust_anchor: impl AsRef<[u8]>,
) -> TlsServer<F>
pub fn client_auth_optional( self, trust_anchor: impl AsRef<[u8]>, ) -> TlsServer<F>
Specify the in-memory contents of the trust anchor for optional client authentication.
Anonymous and authenticated clients will be accepted. If no trust anchor is provided by any
of the client_auth_ methods, then client authentication is disabled by default.
This function requires the "tls" feature.
Sourcepub fn client_auth_required(
self,
trust_anchor: impl AsRef<[u8]>,
) -> TlsServer<F>
pub fn client_auth_required( self, trust_anchor: impl AsRef<[u8]>, ) -> TlsServer<F>
Specify the in-memory contents of the trust anchor for required client authentication.
Only authenticated clients will be accepted. If no trust anchor is provided by any of the
client_auth_ methods, then client authentication is disabled by default.
This function requires the "tls" feature.
Sourcepub fn ocsp_resp(self, resp: impl AsRef<[u8]>) -> TlsServer<F>
pub fn ocsp_resp(self, resp: impl AsRef<[u8]>) -> TlsServer<F>
Specify the DER-encoded OCSP response.
This function requires the "tls" feature.
Sourcepub async fn run(self, addr: impl Into<SocketAddr>)
pub async fn run(self, addr: impl Into<SocketAddr>)
Run this TlsServer forever on the current thread.
This function requires the "tls" feature.
Sourcepub async fn bind(self, addr: impl Into<SocketAddr>)
pub async fn bind(self, addr: impl Into<SocketAddr>)
Bind to a socket address, returning a Future that can be
executed on a runtime.
This function requires the "tls" feature.
Sourcepub fn bind_ephemeral(
self,
addr: impl Into<SocketAddr>,
) -> (SocketAddr, impl Future<Output = ()> + 'static)
pub fn bind_ephemeral( self, addr: impl Into<SocketAddr>, ) -> (SocketAddr, impl Future<Output = ()> + 'static)
Bind to a possibly ephemeral socket address.
Returns the bound address and a Future that can be executed on
any runtime.
This function requires the "tls" feature.
Sourcepub fn bind_with_graceful_shutdown(
self,
addr: impl Into<SocketAddr> + 'static,
signal: impl Future<Output = ()> + Send + 'static,
) -> (SocketAddr, impl Future<Output = ()> + 'static)
pub fn bind_with_graceful_shutdown( self, addr: impl Into<SocketAddr> + 'static, signal: impl Future<Output = ()> + Send + 'static, ) -> (SocketAddr, impl Future<Output = ()> + 'static)
Create a server with graceful shutdown signal.
When the signal completes, the server will start the graceful shutdown process.
This function requires the "tls" feature.