diff options
author | Andras Timar <andras.timar@collabora.com> | 2022-06-30 18:31:14 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2023-01-28 19:19:48 +0000 |
commit | d95ac1c608caba9cabaa503f1a5589285547aed5 (patch) | |
tree | 5df46b3dba3d03488a458c61c17e373c6017be21 /ucb/source | |
parent | fa29398e98f01001c24e7d6856179dbf8124e5b6 (diff) |
LOK: Allow image upload from WOPI-like host with self-signed cert
Change-Id: I28a7de489b06fd5a993b82bb39274eb6f0c373ce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146298
Tested-by: Jenkins
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'ucb/source')
-rw-r--r-- | ucb/source/ucp/webdav-curl/CurlSession.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ucb/source/ucp/webdav-curl/CurlSession.cxx b/ucb/source/ucp/webdav-curl/CurlSession.cxx index 1632881cb824..0f06363ce68f 100644 --- a/ucb/source/ucp/webdav-curl/CurlSession.cxx +++ b/ucb/source/ucp/webdav-curl/CurlSession.cxx @@ -15,6 +15,7 @@ #include "webdavresponseparser.hxx" #include <comphelper/attributelist.hxx> +#include <comphelper/lok.hxx> #include <comphelper/scopeguard.hxx> #include <comphelper/string.hxx> @@ -717,6 +718,14 @@ CurlSession::CurlSession(uno::Reference<uno::XComponentContext> xContext, rc = curl_easy_setopt(m_pCurl.get(), CURLOPT_FORBID_REUSE, 1L); assert(rc == CURLE_OK); } + // If WOPI-like host has self-signed certificate, it's not possible to insert images + // to the document, so here is a compromise. The user has already accepted the self + // signed certificate in the browser, when we get here. + if (comphelper::LibreOfficeKit::isActive()) + { + rc = curl_easy_setopt(m_pCurl.get(), CURLOPT_SSL_VERIFYPEER, 0L); + assert(rc == CURLE_OK); + } } CurlSession::~CurlSession() {} |