Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make pub Channel fns that allow creating it from a custom connector #2015

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Oct 18, 2024

  1. feat: make pub Channel fns that allow creating it from a custom con…

    …nector
    
    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.
    shikhar committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    3363440 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7515622 View commit details
    Browse the repository at this point in the history