Skip to content

Conversation

alce
Copy link
Collaborator

@alce alce commented Sep 1, 2020

This pr enables automatic tls configuration for clients, when certain conditions are met. It enables clients to connect to a tls server without explicitly creating a ClientTlsConfig struct and a Channel:

let mut client = GreeterClient::connect("https://example.com").await?;
// client is now usable

For the connector to attempt to add a default tls configuration:

  • the tls-roots feature must be enabled
  • the url passed to connect must have the https scheme
  • the url passed to connect must have a valid domain name (ips are not supported)
  • if the client is created with an explicit channel, the channel must not have tls configured.

If any of these conditions is not met, then the behavior should be exactly as before.
There is some additional work needed to improve errors when connections fail.

closes #418

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add dynamic endpoint scheme detection for enabling tls
2 participants