mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-13 19:01:21 +00:00
Http: probe the CA bundle without throwing on an unreadable path (#15654)
CurlGlobalInit() probed the CA bundle with the throwing fs::exists overload, which returns false only for a missing path and throws on EACCES. An existing but unreadable cert path then killed the GUI at startup instead of falling through to the CA_BUNDLES list. Use the error_code overload at both probe sites. Fixes #15653.
This commit is contained in:
@@ -70,10 +70,14 @@ struct CurlGlobalInit
|
||||
ssl_cafile = X509_get_default_cert_file();
|
||||
|
||||
int replace = true;
|
||||
if (!ssl_cafile || !fs::exists(fs::path(ssl_cafile))) {
|
||||
// ORCA: non-throwing overload; fs_ec is deliberately unread. An existing but unreadable
|
||||
// path (a static build's baked-in OPENSSLDIR run as another user, say) must fall
|
||||
// through to CA_BUNDLES, not throw out of this constructor.
|
||||
boost::system::error_code fs_ec;
|
||||
if (!ssl_cafile || !fs::exists(fs::path(ssl_cafile), fs_ec)) {
|
||||
const char * bundle = nullptr;
|
||||
for (const char * b : CA_BUNDLES) {
|
||||
if (fs::exists(fs::path(b))) {
|
||||
if (fs::exists(fs::path(b), fs_ec)) {
|
||||
::setenv(SSL_CA_FILE, bundle = b, replace);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user