pub struct HttpsConnectorBuilder<State>(_);
Expand description

A builder for an HttpsConnector

This makes configuration flexible and explicit and ensures connector features match crate features

Examples

use hyper_rustls::HttpsConnectorBuilder;

let https = HttpsConnectorBuilder::new()
    .with_webpki_roots()
    .https_only()
    .enable_http1()
    .build();

Implementations§

Creates a new ConnectorBuilder

Passes a rustls ClientConfig to configure the TLS connection

The alpn_protocols field is required to be empty (or the function will panic) and will be rewritten to match the enabled schemes (see enable_http1, enable_http2) before the connector is built.

Available on crate feature rustls-native-certs only.

Shorthand for using rustls’ safe defaults and native roots

See ConfigBuilderExt::with_native_roots

Available on crate feature webpki-roots only.

Shorthand for using rustls’ safe defaults and Mozilla roots

See ConfigBuilderExt::with_webpki_roots

Enforce the use of HTTPS when connecting

Only URLs using the HTTPS scheme will be connectable.

Allow both HTTPS and HTTP when connecting

HTTPS URLs will be handled through rustls, HTTP URLs will be handled by the lower-level connector.

Enable HTTP1

This needs to be called explicitly, no protocol is enabled by default

Available on crate feature http2 only.

Enable HTTP2

This needs to be called explicitly, no protocol is enabled by default

Override server name for the TLS stack

By default, for each connection hyper-rustls will extract host portion of the destination URL and verify that server certificate contains this value.

If this method is called, hyper-rustls will instead verify that server certificate contains override_server_name. Domain name included in the URL will not affect certificate validation.

Available on crate feature http2 only.

Enable HTTP2

This needs to be called explicitly, no protocol is enabled by default

This builds an HttpsConnector built on hyper’s default HttpConnector

This wraps an arbitrary low-level connector into an HttpsConnector

This builds an HttpsConnector built on hyper’s default HttpConnector

This wraps an arbitrary low-level connector into an HttpsConnector

Trait Implementations§

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more