Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tonic/src/transport/channel/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl Endpoint {
let me = dst.try_into().map_err(|e| Error::from_source(e.into()))?;
#[cfg(feature = "_tls-any")]
if let EndpointType::Uri(uri) = &me.uri {
if uri.scheme() == Some(&http::uri::Scheme::HTTPS) {
if me.tls.is_none() && uri.scheme() == Some(&http::uri::Scheme::HTTPS) {
return me.tls_config(ClientTlsConfig::new().with_enabled_roots());
}
}
Expand Down
4 changes: 3 additions & 1 deletion tonic/src/transport/channel/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,13 @@ impl ClientTlsConfig {

/// Activates all TLS roots enabled through `tls-*-roots` feature flags
pub fn with_enabled_roots(self) -> Self {
let config = ClientTlsConfig::new();
let config = self;

#[cfg(feature = "tls-native-roots")]
let config = config.with_native_roots();
#[cfg(feature = "tls-webpki-roots")]
let config = config.with_webpki_roots();

config
}

Expand Down
Loading