-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
I have some code like the following:
use tonic::transport::{Channel, Endpoint, ClientTlsConfig, Error};
fn connect_endpoint(url: String) -> Result<Channel, Error> {
let channel = Endpoint::try_from(url)?
.tls_config(ClientTlsConfig::new().with_enabled_roots())?
.connect_lazy();
Ok(channel)
}
This works fine if I pass a URL like https://example.com
or http://127.0.0.1:1234
but it fails if I pass http://[::1]:1234
which is a valid URL.
The error is:
Error:
0: transport error
1: invalid dns name
Which comes from this line:
domain: Arc::new(ServerName::try_from(domain)?.to_owned()), |
Metadata
Metadata
Assignees
Labels
No labels