curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Non-constness of field "data" in "struct curl_blob" with setopt

From: Laurent Dufresne via curl-library <curl-library_at_cool.haxx.se>
Date: Mon, 22 Feb 2021 15:21:28 +0000

Hi everyone,

Version 7.71.0 of libcurl added few more options to enable user to easily use Mutual TLS.
Two of them, namely CURLOPT_SSLCERT_BLOB and CURLOPT_SSLKEY_BLOB, take a "struct curl_blob" as parameter and this structure has a pointer to the data with type "void *".
A very common case is to have a "const char *" that point to a PEM formatted string and in such case one would have to make a non-const copy to correctly/safely use the API.
This is even more awkward when using "CURL_BLOB_COPY", because the user would theoretically have to do a copy to a "char *" or "char[N]" to leverage the copy.

It seems slightly strange and I was wondering if this was indeed a requirement or something that could be change or be documented?

Cheers,
Laurent


-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.se/mail/etiquette.html
Received on 2021-02-22