We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1807534 commit 30a2741Copy full SHA for 30a2741
1 file changed
client/src/lib.rs
@@ -607,11 +607,13 @@ impl ClientOptions {
607
/// Passes it through if TLS options not set.
608
async fn add_tls_to_channel(&self, mut channel: Endpoint) -> Result<Endpoint, ClientInitError> {
609
if let Some(tls_cfg) = &self.tls_cfg {
610
- let mut tls = tonic::transport::ClientTlsConfig::new().with_native_roots();
+ let mut tls = tonic::transport::ClientTlsConfig::new();
611
612
if let Some(root_cert) = &tls_cfg.server_root_ca_cert {
613
let server_root_ca_cert = Certificate::from_pem(root_cert);
614
tls = tls.ca_certificate(server_root_ca_cert);
615
+ } else {
616
+ tls = tls.with_native_roots();
617
}
618
619
if let Some(domain) = &tls_cfg.domain {
0 commit comments