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.

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.

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.

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