Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: make pub
Channel
fns that allow creating it from a custom con…
…nector (#2015) * feat: make pub `Channel` fns that allow creating it from a custom connector The connector is required to be a `Service` that accepts a `http::Uri` and returns a connection implementing hyper's IO traits, which is a very reasonable requirement that can be fulfilled by advanced users that need to customize any mechanics that don't fit into the paved path for HTTP and HTTPS with tonic. One such requirement is customizing `rustls::ClientConfig`, which has come up for a number of users. They have been pointed in the direction of a custom connector, but the APIs on `Endpoint` are not always suitable: `Enedpoint::connect_(lazy_)with_connector` always wraps the provided connector with `transport::channel::service::Connector`. This wrapper validates if the scheme is HTTPS, the TLS feature is enabled, and TLS was not configured on the endpoint, and raises an error `HttpsUriWithoutTlsSupport` in this situation. This is a good safety feature in general, but not if the wrapped connector is taking care of TLS. As a side bonus, `tonic::transport::channel::service::io::BoxedIo` can be avoided. * chore: remove redundant bound on connections
- Loading branch information