Allow building with native-tls (#303)

Right now we only support building with Rustls. However, there are quite
a few architectures that aren't yet supported by "ring" (the crypto
library used by Rustls), for example MIPS, PowerPC or SPARC.

To offer an alternative, I added the "native-tls" feature that can be
used instead of "native-roots". When used, the native TLS stack is used
instead of Rustls (i.e. SChannel on Windows, Secure Transport on macOS
and OpenSSL otherwise).
This commit is contained in:
Danilo Bargen 2023-02-14 18:21:07 +01:00 committed by GitHub
commit 94d56c01a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 130 additions and 3 deletions

View file

@ -46,9 +46,20 @@ filetime = "0.2.10"
[features]
default = ["native-roots"]
logging = ["env_logger"]
# Reqwest (the HTTP client library) can handle TLS connections in three
# different modes:
#
# - Rustls with native roots
# - Rustls with WebPK roots
# - Native TLS (SChannel on Windows, Secure Transport on macOS and OpenSSL otherwise)
#
# Exactly one of the three variants must be selected. By default, Rustls with
# native roots is enabled.
native-roots = ["reqwest/rustls-tls-native-roots"]
webpki-roots = ["reqwest/rustls-tls-webpki-roots"]
logging = ["env_logger"]
native-tls = ["reqwest/native-tls"]
[profile.release]
lto = true