2021-03-16 20:09:47 -04:00
|
|
|
# Rustls
|
|
|
|
|
|
|
|
[Rustls is a TLS backend written in Rust.](https://docs.rs/rustls/). Curl can
|
|
|
|
be built to use it as an alternative to OpenSSL or other TLS backends. We use
|
2021-06-24 22:43:19 -04:00
|
|
|
the [rustls-ffi C bindings](https://github.com/rustls/rustls-ffi/). This
|
2021-06-29 02:27:01 -04:00
|
|
|
version of curl depends on version v0.7.0 of rustls-ffi.
|
2021-03-16 20:09:47 -04:00
|
|
|
|
|
|
|
# Building with rustls
|
|
|
|
|
|
|
|
First, [install Rust](https://rustup.rs/).
|
|
|
|
|
2021-06-29 02:27:01 -04:00
|
|
|
Next, check out, build, and install the appropriate version of rustls-ffi:
|
2021-03-16 20:09:47 -04:00
|
|
|
|
|
|
|
% cargo install cbindgen
|
2021-06-24 22:43:19 -04:00
|
|
|
% git clone https://github.com/rustls/rustls-ffi -b v0.7.0
|
2021-06-29 02:27:01 -04:00
|
|
|
% cd rustls-ffi
|
2021-03-16 20:09:47 -04:00
|
|
|
% make
|
2021-06-29 02:27:01 -04:00
|
|
|
% make DESTDIR=${HOME}/rustls-ffi-built/ install
|
2021-03-16 20:09:47 -04:00
|
|
|
|
|
|
|
Now configure and build curl with rustls:
|
|
|
|
|
|
|
|
% git clone https://github.com/curl/curl
|
|
|
|
% cd curl
|
|
|
|
% ./buildconf
|
2021-06-29 02:27:01 -04:00
|
|
|
% ./configure --with-rustls=${HOME}/rustls-ffi-built
|
2021-03-16 20:09:47 -04:00
|
|
|
% make
|