Skip to content

Commit 6fda5dc

Browse files
committed
favor native roots over webpki
1 parent 852b22d commit 6fda5dc

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

launchdarkly-server-sdk/src/data_source_builders.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,11 @@ impl<C> PollingDataSourceBuilder<C> {
243243
impl<C> DataSourceFactory for PollingDataSourceBuilder<C>
244244
where
245245
C: tower::Service<Uri> + Clone + Send + Sync + 'static,
246-
C::Response: hyper_util::client::legacy::connect::Connection + hyper::rt::Read + hyper::rt::Write + Send + Unpin,
246+
C::Response: hyper_util::client::legacy::connect::Connection
247+
+ hyper::rt::Read
248+
+ hyper::rt::Write
249+
+ Send
250+
+ Unpin,
247251
C::Future: Send + Unpin + 'static,
248252
C::Error: Into<Box<dyn std::error::Error + Send + Sync>>,
249253
{
@@ -258,7 +262,11 @@ where
258262
#[cfg(feature = "rustls")]
259263
None => {
260264
let connector = HttpsConnectorBuilder::new()
261-
.with_webpki_roots()
265+
.with_native_roots()
266+
.unwrap_or_else(|_| {
267+
log::debug!("Falling back to webpki roots for polling HTTPS connector");
268+
HttpsConnectorBuilder::new().with_webpki_roots()
269+
})
262270
.https_or_http()
263271
.enable_http1()
264272
.enable_http2()

launchdarkly-server-sdk/src/events/processor_builders.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,11 @@ pub struct EventProcessorBuilder<C> {
8888
impl<C> EventProcessorFactory for EventProcessorBuilder<C>
8989
where
9090
C: tower::Service<Uri> + Clone + Send + Sync + 'static,
91-
C::Response: hyper_util::client::legacy::connect::Connection + hyper::rt::Read + hyper::rt::Write + Send + Unpin,
91+
C::Response: hyper_util::client::legacy::connect::Connection
92+
+ hyper::rt::Read
93+
+ hyper::rt::Write
94+
+ Send
95+
+ Unpin,
9296
C::Future: Send + Unpin + 'static,
9397
C::Error: Into<Box<dyn std::error::Error + Send + Sync>>,
9498
{
@@ -122,7 +126,11 @@ where
122126
#[cfg(feature = "rustls")]
123127
{
124128
let connector = HttpsConnectorBuilder::new()
125-
.with_webpki_roots()
129+
.with_native_roots()
130+
.unwrap_or_else(|_| {
131+
log::debug!("Falling back to webpki roots for event HTTPS connector");
132+
HttpsConnectorBuilder::new().with_webpki_roots()
133+
})
126134
.https_or_http()
127135
.enable_http1()
128136
.enable_http2()

0 commit comments

Comments
 (0)