Skip to content

Commit e4df91c

Browse files
adapter: run the LaunchDarkly HTTPS transport on aws-lc-rs, not ring
The `launchdarkly-sdk-transport` crate's `build_https` hardcodes its `hyper-rustls` dependency to the `ring` crypto provider, which is not FIPS 140-3 validated. The crate exposes no aws-lc-rs feature, so we cannot select the provider there. Instead, build a `hyper-rustls` `HttpsConnector` on the aws-lc-rs rustls provider ourselves and inject it via the transport crate's `build_with_connector`. To keep the ring-pinned `hyper-rustls` out of the build entirely, the workspace now selects only the base `hyper` feature on both `launchdarkly-server-sdk` and `launchdarkly-sdk-transport` (dropping `hyper-rustls-native-roots`, which was the sole activator of `hyper-rustls/ring`), and `mz-adapter` depends on `hyper-rustls` and `rustls` directly. `ring` is no longer reachable through the LaunchDarkly transport path. It remains only as a direct dependency of `gcp_auth`. native-tls was already eliminated on the LD-3.1.1 base, so this closes the remaining crypto-provider gap for the FIPS migration. The `MetricsTransport` wrapping and the event-processor / streaming data-source builders are unchanged: only the underlying HTTPS transport's crypto provider changes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent da5a8c4 commit e4df91c

4 files changed

Lines changed: 37 additions & 7 deletions

File tree

‎Cargo.lock‎

Lines changed: 2 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,14 @@ hyper = { version = "1.9.0", features = ["http1", "server"] }
389389
# which can only be done by constructing the HTTP Client
390390
hyper-0-14 = { package = "hyper", version = "0.14", features = ["client", "tcp"] }
391391
hyper-openssl = "0.10.2"
392+
# `aws-lc-rs` selects the FIPS-capable crypto provider (not `ring`), `native-tokio`
393+
# brings the `rustls-native-certs` roots that `with_provider_and_native_roots`
394+
# needs, and `http1`/`http2` cover the LaunchDarkly streaming and event
395+
# connections. We keep `default-features = false` to leave out the `logging`
396+
# feature, which would pull in the (workspace-banned) `log` crate. Used by
397+
# `mz-adapter` to build a FIPS-capable HTTPS connector for the LaunchDarkly
398+
# transport.
399+
hyper-rustls = { version = "0.27", default-features = false, features = ["aws-lc-rs", "native-tokio", "http1", "http2", "tls12"] }
392400
hyper-util = "0.1.20"
393401
tower-service = "0.3.3"
394402
iceberg = "0.9.0"
@@ -407,8 +415,17 @@ junit-report = "0.8.3"
407415
k8s-controller = "0.11.0"
408416
k8s-openapi = { version = "0.27.0", features = ["schemars", "v1_32"] }
409417
kube = { version = "3.1.0", default-features = false, features = ["client", "derive", "openssl-tls", "runtime", "ws"] }
410-
launchdarkly-server-sdk = { version = "3.1.1", default-features = false, features = ["hyper-rustls-native-roots", "crypto-aws-lc-rs"] }
411-
launchdarkly-sdk-transport = "0.1"
418+
# We select only the base `hyper` feature, not `hyper-rustls-native-roots`. That
419+
# feature would enable `launchdarkly-sdk-transport`'s `hyper-rustls` dependency,
420+
# which the transport crate hardcodes to the `ring` crypto provider (not
421+
# FIPS-validated). We supply our own aws-lc-rs-backed HTTPS connector to the
422+
# transport instead. See `mz-adapter`'s `config::frontend::ld_config`.
423+
launchdarkly-server-sdk = { version = "3.1.1", default-features = false, features = ["hyper", "crypto-aws-lc-rs"] }
424+
# `default-features = false` with only `hyper` keeps the transport crate's
425+
# ring-pinned `hyper-rustls` dependency out of the build. The `hyper` feature
426+
# still exposes `HyperTransport::builder()` and `build_with_connector`, which we
427+
# use to inject an aws-lc-rs connector.
428+
launchdarkly-sdk-transport = { version = "0.1", default-features = false, features = ["hyper"] }
412429
lgalloc = "0.6.0"
413430
libc = "0.2.186"
414431
lru = "0.16.3"

‎src/adapter/Cargo.toml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ futures.workspace = true
2727
governor.workspace = true
2828
hex.workspace = true
2929
humantime.workspace = true
30+
hyper-rustls.workspace = true
3031
imbl.workspace = true
3132
http.workspace = true
3233
ipnet.workspace = true
@@ -83,6 +84,7 @@ prost.workspace = true
8384
qcell.workspace = true
8485
rand.workspace = true
8586
rand_chacha.workspace = true
87+
rustls.workspace = true
8688
semver.workspace = true
8789
serde.workspace = true
8890
serde_json.workspace = true

‎src/adapter/src/config/frontend.rs‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,10 +385,23 @@ impl<T: HttpTransport> HttpTransport for MetricsTransport<T> {
385385
}
386386

387387
fn ld_config(api_key: &str, metrics: &Metrics, now_fn: &NowFn) -> ld::Config {
388+
// Build the HTTPS connector on the aws-lc-rs rustls crypto provider. The
389+
// `launchdarkly-sdk-transport` crate's own `build_https` hardcodes rustls to
390+
// the `ring` provider, which is not FIPS-validated. We name the aws-lc-rs
391+
// provider explicitly and inject the connector via `build_with_connector`.
392+
// Native roots match the trust store the SDK used under the transport
393+
// crate's `hyper-rustls-native-roots` feature, which we no longer enable.
394+
let https = hyper_rustls::HttpsConnectorBuilder::new()
395+
.with_provider_and_native_roots(rustls::crypto::aws_lc_rs::default_provider())
396+
.expect("failed to load native root certificates")
397+
.https_only()
398+
.enable_http1()
399+
.enable_http2()
400+
.build();
388401
let transport = launchdarkly_sdk_transport::HyperTransport::builder()
389402
.connect_timeout(Duration::from_secs(10))
390403
.read_timeout(Duration::from_secs(300))
391-
.build_https()
404+
.build_with_connector(https)
392405
.expect("failed to create HTTPS transport");
393406

394407
let cse_transport = MetricsTransport {

0 commit comments

Comments
 (0)