diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-06-04 16:35:57 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2024-06-24 17:14:02 +0200 |
commit | 20ea603bcc2dda0355dea19f86e02854df8286ba (patch) | |
tree | 10277257fe69317b3b363670c2229d78c34d3842 | |
parent | c8951e5462d61068ae432d999ea4150027b58135 (diff) |
map LO_CERTIFICATE_AUTHORITY_PATH to CURLOPT_CAPATH
curl has both CURLOPT_CAINFO for the single-file collection
of certificates case and CURLOPT_CAPATH for the multi-file
exploder view of certificates, this adds support to
use CURLOPT_CAPATH as well as CURLOPT_CAINFO
Change-Id: I28163bbe81fa389eea70ef1289ed04a50a029c5f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169117
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r-- | include/systools/curlinit.hxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/systools/curlinit.hxx b/include/systools/curlinit.hxx index b6ada72105a3..526ffcd384f3 100644 --- a/include/systools/curlinit.hxx +++ b/include/systools/curlinit.hxx @@ -34,6 +34,18 @@ static void InitCurl_easy(CURL* const pCURL) { throw css::uno::RuntimeException("CURLOPT_CAINFO failed"); } + + // curl: "If you have a CA cert for the server stored someplace else than + // in the default bundle, then the CURLOPT_CAPATH option might come handy + // for you" + if (char const* const capath = getenv("LO_CERTIFICATE_AUTHORITY_PATH")) + { + rc = curl_easy_setopt(pCURL, CURLOPT_CAPATH, capath); + if (rc != CURLE_OK) + { + throw css::uno::RuntimeException("CURLOPT_CAPATH failed"); + } + } #endif curl_version_info_data const* const pVersion(curl_version_info(CURLVERSION_NOW)); |