summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-03-31 20:25:41 +0100
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2024-04-10 22:51:50 +0200
commit4c3b2e13f2f9e0acf4529add0748acb010157ab4 (patch)
tree8654d7c7442fa0814d8dbc1c7f2a01df8e7af474
parentRelated: tdf#157480 vcl,openssl: set SSL_CERT_FILE for bundled OpenSSL (diff)
downloadcore-4c3b2e13f2f9e0acf4529add0748acb010157ab4.tar.gz
core-4c3b2e13f2f9e0acf4529add0748acb010157ab4.zip
Related: tdf#157480 use SSL_CERT_FILE on macOS too
for SSL use by pyuno emailmerge another alternative mechanism that could work is to generate one with something like: "security find-certificate -a -p > cert.pem" ref: https: //hynek.me/articles/apple-openssl-verification-surprises/ Change-Id: I8bff2ca5bbbb4f2c2333a67e0281dd4fa0b06405 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165625 Reviewed-by: Patrick Luby <guibomacdev@gmail.com> Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165921 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
-rw-r--r--include/curlinit.hxx4
-rw-r--r--include/opensslinit.hxx3
-rw-r--r--vcl/source/app/svmain.cxx2
3 files changed, 6 insertions, 3 deletions
diff --git a/include/curlinit.hxx b/include/curlinit.hxx
index 18888cf766f9..2e4b09b4163a 100644
--- a/include/curlinit.hxx
+++ b/include/curlinit.hxx
@@ -11,7 +11,9 @@
#include <curl/curl.h>
-#if defined(LINUX) && !defined(SYSTEM_CURL)
+// curl is built with --with-secure-transport on macOS and iOS so doesn't need these
+// certs. Windows doesn't need them either, but lets assume everything else does
+#if !defined(SYSTEM_OPENSSL) && !defined(_WIN32) && !defined(MACOSX) && !defined(IOS)
#include <com/sun/star/uno/RuntimeException.hpp>
#include "opensslinit.hxx"
diff --git a/include/opensslinit.hxx b/include/opensslinit.hxx
index 9c3f4c860895..fcece77a22c1 100644
--- a/include/opensslinit.hxx
+++ b/include/opensslinit.hxx
@@ -11,7 +11,7 @@
#include <config_crypto.h>
-#if defined(LINUX) && !defined(SYSTEM_OPENSSL)
+#if !defined(_WIN32) && !defined(SYSTEM_OPENSSL)
#include <com/sun/star/uno/RuntimeException.hpp>
#include <unistd.h>
@@ -25,6 +25,7 @@ static char const* GetCABundleFile()
"/etc/pki/tls/certs/ca-bundle.trust.crt",
"/etc/ssl/certs/ca-certificates.crt",
"/var/lib/ca-certificates/ca-bundle.pem",
+ "/etc/ssl/cert.pem", // macOS has one at this location
};
for (char const* const candidate : candidates)
{
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index 2cb3d393d5b9..2cd68fc7d56f 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -194,7 +194,7 @@ int ImplSVMain()
const bool bWasInitVCL = IsVCLInit();
-#if defined(LINUX) && !defined(SYSTEM_OPENSSL)
+#if !defined(_WIN32) && !defined(SYSTEM_OPENSSL)
if (!bWasInitVCL)
{
OUString const name("SSL_CERT_FILE");