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