Skip to content

[Task] Get rid of ring dependency in core #3226

@Yury-Fridlyand

Description

@Yury-Fridlyand

Description

Old version of ring is presend in cargo dependency tree (cargo tree), all CI fails now: https://github.com/valkey-io/valkey-glide/actions/runs/13466704614/job/37633907140#step:3:878.
It is a dependency of rustls and rustls-webpki, but even most recent version of rustls uses the same version of ring (one, two).

This crate is only used to partially validate certificates on unsecure TLS connections. This API (using non-secure TLS, e.g. self-signed certificates) isn't exposed to wrappers and to end users.

match (insecure, cfg!(feature = "tls-rustls-insecure")) {
#[cfg(feature = "tls-rustls-insecure")]
(true, true) => {
let mut config = config;
config.enable_sni = false;
// nosemgrep
config
.dangerous()
.set_certificate_verifier(Arc::new(NoCertificateVerification {
supported: rustls::crypto::ring::default_provider()
.signature_verification_algorithms,
}));
Ok(config)

Solution could be:

  • Contribue to rustls and rustls-webpki by updating ring dependency, wait for newer version of rustls and rustls-webpki released, then update these dependencies in GLIDE
  • Remove this validations (set_certificate_verifier(Arc::new(NoCertificateVerification {})))
  • Replace with another implementation, which doesn't use ring (e.g. https://gist.github.com/doroved/2c92ddd5e33f257f901c763b728d1b61)

Checklist

No response

Additional Notes

No response

Metadata

Metadata

Assignees

Labels

Core changes 🪐Used to label a PR as PR with significant changes that should trigger a full matrix tests.

Type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions