1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-24 15:26:15 +00:00

Allow system certs file to be used by Editor.

Note, it will only used by the Editor, not when running the game.
This allows package maintainer to compile Godot to use system installed
certificates when accessing the AssetLib.
This commit is contained in:
Fabio Alessandrelli
2018-09-15 14:45:54 +02:00
parent d2b38aabec
commit 0e56377e96
8 changed files with 59 additions and 23 deletions

View File

@@ -73,6 +73,7 @@
#include "editor/doc/doc_data.h"
#include "editor/doc/doc_data_class_path.gen.h"
#include "editor/editor_node.h"
#include "editor/editor_settings.h"
#include "editor/project_manager.h"
#endif
@@ -756,7 +757,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
if (editor) {
packed_data->set_disabled(true);
globals->set_disable_feature_overrides(true);
StreamPeerSSL::initialize_certs = false; //will be initialized by editor
}
#endif
@@ -1595,6 +1595,7 @@ bool Main::start() {
sml->set_use_font_oversampling(font_oversampling);
} else {
GLOBAL_DEF("display/window/stretch/mode", "disabled");
ProjectSettings::get_singleton()->set_custom_property_info("display/window/stretch/mode", PropertyInfo(Variant::STRING, "display/window/stretch/mode", PROPERTY_HINT_ENUM, "disabled,2d,viewport"));
GLOBAL_DEF("display/window/stretch/aspect", "ignore");
@@ -1654,6 +1655,10 @@ bool Main::start() {
}
if (!project_manager && !editor) { // game
// Load SSL Certificates from Project Settings (or builtin)
StreamPeerSSL::load_certs_from_memory(StreamPeerSSL::get_project_cert_array());
if (game_path != "") {
Node *scene = NULL;
Ref<PackedScene> scenedata = ResourceLoader::load(local_game_path);
@@ -1686,6 +1691,15 @@ bool Main::start() {
sml->get_root()->add_child(pmanager);
OS::get_singleton()->set_context(OS::CONTEXT_PROJECTMAN);
}
if (project_manager || editor) {
// Load SSL Certificates from Editor Settings (or builtin)
String certs = EditorSettings::get_singleton()->get_setting("network/ssl/editor_ssl_certificates").operator String();
if (certs != "")
StreamPeerSSL::load_certs_from_file(certs);
else
StreamPeerSSL::load_certs_from_memory(StreamPeerSSL::get_project_cert_array());
}
#endif
}