mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-02-05 07:35:55 +01:00
Pre-create the required folders for the self signed cert files automatically.
This commit is contained in:
parent
ab9ae594c2
commit
0e651dd4fd
@ -30,6 +30,8 @@
|
||||
|
||||
#include "http_server_simple.h"
|
||||
|
||||
#include "core/os/dir_access.h"
|
||||
|
||||
#include "http_parser.h"
|
||||
#include "modules/web/http/web_server_cookie.h"
|
||||
#include "simple_web_server_request.h"
|
||||
@ -436,6 +438,12 @@ void HTTPServerSimple::_stop_workers() {
|
||||
|
||||
void HTTPServerSimple::_set_internal_certs(Ref<Crypto> p_crypto) {
|
||||
const String cache_path = "user://cache/web/";
|
||||
|
||||
DirAccess *dir = DirAccess::create(DirAccess::ACCESS_USERDATA);
|
||||
ERR_FAIL_COND(!dir);
|
||||
dir->make_dir_recursive(cache_path);
|
||||
memdelete(dir);
|
||||
|
||||
const String key_path = cache_path.plus_file("http_server_simple_cert.key");
|
||||
const String crt_path = cache_path.plus_file("http_server_simple_cert.crt");
|
||||
bool regen = !FileAccess::exists(key_path) || !FileAccess::exists(crt_path);
|
||||
|
Loading…
Reference in New Issue
Block a user