mirror of
https://github.com/openappsec/openappsec.git
synced 2025-09-27 18:28:47 +03:00
fix ca loading for alpine
This commit is contained in:
parent
9cfee35e98
commit
6b9abf6122
@ -28,7 +28,6 @@
|
|||||||
#include "i_shell_cmd.h"
|
#include "i_shell_cmd.h"
|
||||||
#include "i_rest_api.h"
|
#include "i_rest_api.h"
|
||||||
#include "i_instance_awareness.h"
|
#include "i_instance_awareness.h"
|
||||||
#include "i_details_resolver.h"
|
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
@ -44,8 +43,7 @@ class Messaging
|
|||||||
Singleton::Consume<I_ShellCmd>,
|
Singleton::Consume<I_ShellCmd>,
|
||||||
Singleton::Consume<I_MainLoop>,
|
Singleton::Consume<I_MainLoop>,
|
||||||
Singleton::Consume<I_RestApi>,
|
Singleton::Consume<I_RestApi>,
|
||||||
Singleton::Consume<I_InstanceAwareness>,
|
Singleton::Consume<I_InstanceAwareness>
|
||||||
Singleton::Consume<I_DetailsResolver>
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Messaging();
|
Messaging();
|
||||||
|
@ -272,24 +272,16 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Use detail_resolver to determine platform-specific certificate directory
|
// Use detail_resolver to determine platform-specific certificate directory
|
||||||
auto maybe_platform = Singleton::Consume<I_DetailsResolver>::by<Messaging>()->getPlatform();
|
#if defined(alpine)
|
||||||
|
string platform = "alpine";
|
||||||
|
#else
|
||||||
|
string platform = "linux";
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!maybe_platform.ok()) {
|
|
||||||
dbgTrace(D_CONNECTION)
|
|
||||||
<< "Failed to get platform for default certificate directory: "
|
|
||||||
<< maybe_platform.getErr();
|
|
||||||
return "/usr/lib/ssl/certs/"; // Fallback for failed platform detection
|
|
||||||
}
|
|
||||||
|
|
||||||
auto platform = maybe_platform.unpack();
|
|
||||||
if (platform == "alpine") {
|
if (platform == "alpine") {
|
||||||
return "/etc/ssl/certs/";
|
return "/etc/ssl/certs/";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (platform == "linux") {
|
|
||||||
return "/usr/lib/ssl/certs/";
|
|
||||||
}
|
|
||||||
|
|
||||||
return "/usr/lib/ssl/certs/";
|
return "/usr/lib/ssl/certs/";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user