rust-electrum-client icon indicating copy to clipboard operation
rust-electrum-client copied to clipboard

Add use-rustls-ring feature

Open thunderbiscuit opened this issue 1 year ago • 0 comments

This PR adds the ability to build the client using the ring dependency for rustls instead of the new default aws-lc-rs.

As of the 0.23.0 release, rustls changed its default cryptography provider to aws-lc-rs. This new library is actually a set of bindings to a C library maintained by AWS, and they provide prebuilt bindings for some platforms but not all. On these other platforms, the compilation step will attempt to build the bindings, requiring extra dependencies (CMake, libclang and others depending on the platform). This compilation step is what is currently breaking our Android and Swift builds for bdk-ffi. It is certainly possible to build the bindings (and the AWS docs on it are very nice), but for some reason I have not been able to make it work everywhere yet (local, CI, Windows).

This PR enables us to use the previous default ring library for rustls. I basically have to turn off the default features on rustls and re-enable all of them except for the aws_lc_rs. We also have a few feature-gated constructs in the library, for which I needed to add the new proposed use-rustls-ring feature in order to make all of this work for us. Let me know if there are maybe better ways to achieve this!

thunderbiscuit avatar Jun 26 '24 14:06 thunderbiscuit