ucb curl: don't verify peer in the isExemptVerifyHost() case
Try to insert a https:// image URL into Writer when the URL's host is
meant to be not verified, 'curl -k' works with the URL but insertion in
Writer still fails.
Turns out this is an expired self-signed certificate (in a local test
env). Mechanism for not verifying SSL certs in the curl session was
added in commit 2a5c998d4c (allow an
exemption to be made for a specific host, 2024-08-23), but that results
in an image insertion failure.
Fix the problem by adapting the ucb/ code to do what
<https://github.com/curl/curl/blob/470e26ff6eb55e8d18d6fa44104834e9d1f71274/src/config2setopts.c#L375>
does for 'curl -k', also clear the CURLOPT_SSL_VERIFYPEER option.
With this, inserting https:// images from my local test server works
again in Writer.
Change-Id: I0c52f6c0c0dfd6ebf0b4081a8088b623935a96f7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197093
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
This commit is contained in:
@@ -826,6 +826,7 @@ CurlSession::CurlSession(uno::Reference<uno::XComponentContext> xContext,
|
||||
}
|
||||
if (HostFilter::isExemptVerifyHost(m_URI.GetHost()))
|
||||
{
|
||||
rc = curl_easy_setopt(m_pCurl.get(), CURLOPT_SSL_VERIFYPEER, 0L);
|
||||
rc = curl_easy_setopt(m_pCurl.get(), CURLOPT_SSL_VERIFYHOST, 0L);
|
||||
assert(rc == CURLE_OK);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user