-
Notifications
You must be signed in to change notification settings - Fork 251
Description
It would be a large benefit to the Rust community if the curl crate could have an opt-in rustls feature that, when building the bundled libcurl, allows you to use rustls as a TLS backend.
This is possible to do by implementing a compatibility layer between libcurl and rustls by implementing libcurl's internal vtls interface -- rustls does not need to behave like OpenSSL or anything else, it only needs to perform the functions required by the vtls interface.
This compatibility layer could then be exposed as unmangled symbol names for libcurl to reference, which is legal since only one version of the curl crate can exist in a binary per Cargo's linking rules. To actually get libcurl to use the rustls backend, we could either:
- Apply a small patch to the libcurl source code that adds the rustls-vtls symbols as an additional (and the selected) backend.
- Have the rustls-vtls symbols impersonate a different, existing backend, and don't include the real backend's
.cfile when we compile.
I've done some investigation and experimentation into this concept myself and it seems feasible.