vcl: don't override user's SSL_CERT_FILE for bundled OpenSSL
Change-Id: I5d61fe62c2e6814ea757a0b543f7dbf45e0db456 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159219 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
This commit is contained in:
@@ -196,12 +196,15 @@ int ImplSVMain()
|
|||||||
|
|
||||||
#if defined(LINUX) && !defined(SYSTEM_OPENSSL)
|
#if defined(LINUX) && !defined(SYSTEM_OPENSSL)
|
||||||
if (!bWasInitVCL)
|
if (!bWasInitVCL)
|
||||||
|
{
|
||||||
|
OUString constexpr name(u"SSL_CERT_FILE"_ustr);
|
||||||
|
OUString temp;
|
||||||
|
if (osl_getEnvironment(name.pData, &temp.pData) == osl_Process_E_NotFound)
|
||||||
{
|
{
|
||||||
try // to point bundled OpenSSL to some system certificate file
|
try // to point bundled OpenSSL to some system certificate file
|
||||||
{ // ... this only works if the client actually calls
|
{ // ... this only works if the client actually calls
|
||||||
// SSL_CTX_set_default_verify_paths() or similar; e.g. python ssl.
|
// SSL_CTX_set_default_verify_paths() or similar; e.g. python ssl.
|
||||||
char const*const path = GetCABundleFile();
|
char const*const path = GetCABundleFile();
|
||||||
OUString constexpr name(u"SSL_CERT_FILE"_ustr);
|
|
||||||
OUString const filepath(::rtl::OStringToOUString(
|
OUString const filepath(::rtl::OStringToOUString(
|
||||||
::std::string_view(path), osl_getThreadTextEncoding()));
|
::std::string_view(path), osl_getThreadTextEncoding()));
|
||||||
osl_setEnvironment(name.pData, filepath.pData);
|
osl_setEnvironment(name.pData, filepath.pData);
|
||||||
@@ -211,6 +214,7 @@ int ImplSVMain()
|
|||||||
SAL_WARN("vcl", e.Message);
|
SAL_WARN("vcl", e.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const bool bInit = bWasInitVCL || InitVCL();
|
const bool bInit = bWasInitVCL || InitVCL();
|
||||||
|
Reference in New Issue
Block a user