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(tonic): Configure tls automatically when possible #445

Merged
merged 1 commit into from
Apr 23, 2021

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

@LucioFranco LucioFranco merged commit b04c1c6 into hyperium:master Apr 23, 2021
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