Roblox / rs-consul

This crate provides access to a set of strongly typed apis to interact with consul (https://www.consul.io/)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Panic when no CA found

ValentinColin opened this issue · comments

My service is using rsconsul to get his configuration but since I build my image from scratch (compile with musl), no CA cert exist in the container. Then it's panicking...

2024-02-06T16:08:09.156238Z  INFO intel: configuration mode: consul
2024-02-06T16:08:09.156346Z DEBUG hyper_rustls::config: with_native_roots processed 0 valid and 0 invalid certs
thread 'main' panicked at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/hyper-rustls-0.24.2/src/config.rs:48:9:
no CA certificates found
stack backtrace:
   0: rust_begin_unwind
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/panicking.rs:72:14
   2: <rustls::builder::ConfigBuilder<rustls::client::client_conn::ClientConfig,rustls::builder::WantsVerifier> as hyper_rustls::config::ConfigBuilderExt>::with_native_roots
   3: hyper_rustls::connector::builder::ConnectorBuilder<hyper_rustls::connector::builder::WantsTlsConfig>::with_native_roots
   4: rs_consul::Consul::new
   5: intel::main::{{closure}}
   6: tokio::runtime::park::CachedParkThread::block_on
   7: tokio::runtime::context::runtime::enter_runtime
   8: tokio::runtime::runtime::Runtime::block_on
   9: intel::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
2024-02-06T16:08:09.166013Z DEBUG tower::buffer::worker: buffer closing; waking pending tasks 

I think update hyper-rustls is enough (maybe with some fix in rs-consul)

hyper-rustls = "0.24" -> "0.25"

complements:

  • update version of hyper-rustls=0.26, http=1.0, hyper=1.1 (version available at this moment)

Hi @ValentinColin, you should be able to avoid this using the rustls-webpki feature.