rustls: add CURLOPT_CAINFO_BLOB support

Add support for `CURLOPT_CAINFO_BLOB` `CURLOPT_PROXY_CAINFO_BLOB` to the
rustls TLS backend. Multiple certificates in a single PEM string are
supported just like OpenSSL does with this option.

This is compatible at least with rustls-ffi 0.8+ which is our new
minimum version anyway.

I was able to build and run this on Windows, pulling trusted certs from
the system and then add them to rustls by setting
`CURLOPT_CAINFO_BLOB`. Handy!

Closes #8255
This commit is contained in:
Stephen M. Coakley 2022-01-09 15:59:30 -06:00 committed by Daniel Stenberg
parent dbde76bdd6
commit 3be94d84fc
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 33 additions and 5 deletions

View file

@ -62,7 +62,7 @@ if(curl) {
Added in 7.77.0.
This option is supported by the BearSSL (since 7.79.0), mbedTLS (since 7.81.0),
OpenSSL, Secure Transport and Schannel backends.
rustls (since 7.82.0), OpenSSL, Secure Transport and Schannel backends.
.SH RETURN VALUE
Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or
CURLE_OUT_OF_MEMORY if there was insufficient heap space.

View file

@ -65,7 +65,7 @@ if(curl) {
.SH AVAILABILITY
Added in 7.77.0.
This option is supported by the OpenSSL, Secure
This option is supported by the rustls (since 7.82.0), OpenSSL, Secure
Transport and Schannel backends.
.SH RETURN VALUE
Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or