summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorAndras Timar <andras.timar@collabora.com>2022-06-30 18:31:14 +0200
committerAndras Timar <andras.timar@collabora.com>2022-07-02 15:58:28 +0200
commitb1e29e67397d5e94ef23b94a9bceb879c03b027a (patch)
treea02c4adaeca3e63e5de7dbb21c3a1f908fc7e1f1 /ucb
parent1ad7bdafc982a9854e99b5cbec1b44ed96cbe92c (diff)
LOK: Allow image upload from WOPI-like host with self-signed cert
Change-Id: I28a7de489b06fd5a993b82bb39274eb6f0c373ce
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/ucp/webdav-curl/CurlSession.cxx9
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 ef3241f1c3dc..7d56dfebd3e4 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>
@@ -709,6 +710,14 @@ CurlSession::CurlSession(uno::Reference<uno::XComponentContext> const& 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() {}