use-rustls-ring transitively enables rustls/default (aws-lc-rs), breaking ring-only builds

Đang mở Phù hợp với người mới
#219 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

@EddieHouston đang làm issue này rồi.

Từ ngày 2/7/2026.

  • #220 của @EddieHouston — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
76/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
rust
Lĩnh vực
build-system

Hướng nghiên cứu

Bắt đầu với các định nghĩa feature của Cargo cho rustls-ring và rustls được hiển thị trong issue, sau đó chạy cargo tree -e features để xác nhận chuỗi feature hiện tại. Cập nhật các tham chiếu đến feature tùy chọn của rustls để use-rustls-ring không bật rustls/default, và xác minh rằng các bản build ring-only không còn bao gồm aws-lc-rs.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

In 0.25.0 the rustls-ring feature is defined as:

rustls-ring = [
    "webpki-roots",
    "dep:rustls",
    "rustls/ring",
    "rustls/logging",
    "rustls/std",
    "rustls/tls12",
]

The "rustls/ring" entries (without ?) also activate the crate's explicit rustls feature:

rustls = [
    "webpki-roots",
    "dep:rustls",
    "rustls/default",
]

which enables rustls/default, i.e. the aws-lc-rs provider. So a downstream crate asking for use-rustls-ring (expecting ring only) ends up with both ring and aws-lc-rs enabled on rustls. cargo tree -e features shows the chain:

electrum-client feature "rustls"
  └── electrum-client feature "rustls-ring"
      └── electrum-client feature "use-rustls-ring"

Consequences downstream: rustls can no longer auto-select a process-level CryptoProvider, so any other crate in the same binary that relies on the process default panics on first TLS use with:

Could not automatically determine the process-level CryptoProvider from Rustls crate features.

(electrum-client itself is unaffected since it selects its provider explicitly.) We hit this in a project after bumping electrum-client 0.21 -> 0.25: the shared rustls went from ring only to ring + aws-lc-rs + default, and an unrelated tokio-tungstenite connection in the same binary started panicking.

Suggested fix

Use the ? syntax so rustls-ring does not activate the rustls feature:

rustls-ring = [
    "webpki-roots",
    "dep:rustls",
    "rustls?/ring",
    "rustls?/logging",
    "rustls?/std",
    "rustls?/tls12",
]

(0.21 did not have this problem; the regression came with the feature reshuffle in later releases.)

Ngôn ngữ chính
Rust
Star
89
Fork
87
Merge trung bình
1 giờ 25 phút
Pull request đã merge (30 ngày)
4

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của bitcoindevkit/rust-electrum-client

Tất cả issue của bitcoindevkit/rust-electrum-client

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.