2021-03-17 08:09:47 +08:00
|
|
|
# Rustls
|
|
|
|
|
2022-10-26 14:59:35 +08:00
|
|
|
[Rustls is a TLS backend written in Rust](https://docs.rs/rustls/). Curl can
|
2021-03-17 08:09:47 +08:00
|
|
|
be built to use it as an alternative to OpenSSL or other TLS backends. We use
|
2021-06-25 10:43:19 +08:00
|
|
|
the [rustls-ffi C bindings](https://github.com/rustls/rustls-ffi/). This
|
2023-03-30 05:01:55 +08:00
|
|
|
version of curl depends on version v0.10.0 of rustls-ffi.
|
2021-03-17 08:09:47 +08:00
|
|
|
|
|
|
|
# Building with rustls
|
|
|
|
|
|
|
|
First, [install Rust](https://rustup.rs/).
|
|
|
|
|
2021-06-29 14:27:01 +08:00
|
|
|
Next, check out, build, and install the appropriate version of rustls-ffi:
|
2021-03-17 08:09:47 +08:00
|
|
|
|
|
|
|
% cargo install cbindgen
|
2023-03-30 05:01:55 +08:00
|
|
|
% git clone https://github.com/rustls/rustls-ffi -b v0.10.0
|
2021-06-29 14:27:01 +08:00
|
|
|
% cd rustls-ffi
|
2021-03-17 08:09:47 +08:00
|
|
|
% make
|
2021-06-29 14:27:01 +08:00
|
|
|
% make DESTDIR=${HOME}/rustls-ffi-built/ install
|
2021-03-17 08:09:47 +08:00
|
|
|
|
|
|
|
Now configure and build curl with rustls:
|
|
|
|
|
|
|
|
% git clone https://github.com/curl/curl
|
|
|
|
% cd curl
|
2022-05-02 23:52:16 +08:00
|
|
|
% autoreconf -fi
|
2021-06-29 14:27:01 +08:00
|
|
|
% ./configure --with-rustls=${HOME}/rustls-ffi-built
|
2021-03-17 08:09:47 +08:00
|
|
|
% make
|