|
@@ -32,6 +32,10 @@
|
|
|
|
|
|
#include "core/config/project_settings.h"
|
|
|
|
|
|
+#ifdef TOOLS_ENABLED
|
|
|
+#include "editor/editor_settings.h"
|
|
|
+#endif // TOOLS_ENABLED
|
|
|
+
|
|
|
static void my_debug(void *ctx, int level,
|
|
|
const char *file, int line,
|
|
|
const char *str) {
|
|
@@ -148,8 +152,17 @@ Error TLSContextMbedTLS::init_server(int p_transport, Ref<TLSOptions> p_options,
|
|
|
}
|
|
|
|
|
|
#if MBEDTLS_VERSION_MAJOR >= 3
|
|
|
- if (Engine::get_singleton()->is_editor_hint() || !(bool)GLOBAL_GET("network/tls/enable_tls_v1.3")) {
|
|
|
- mbedtls_ssl_conf_max_tls_version(&conf, MBEDTLS_SSL_VERSION_TLS1_2);
|
|
|
+#ifdef TOOLS_ENABLED
|
|
|
+ if (Engine::get_singleton()->is_editor_hint()) {
|
|
|
+ if (!EditorSettings::get_singleton()->get_setting("network/tls/enable_tls_v1.3").operator bool()) {
|
|
|
+ mbedtls_ssl_conf_max_tls_version(&conf, MBEDTLS_SSL_VERSION_TLS1_2);
|
|
|
+ }
|
|
|
+ } else
|
|
|
+#endif
|
|
|
+ {
|
|
|
+ if (!GLOBAL_GET("network/tls/enable_tls_v1.3").operator bool()) {
|
|
|
+ mbedtls_ssl_conf_max_tls_version(&conf, MBEDTLS_SSL_VERSION_TLS1_2);
|
|
|
+ }
|
|
|
}
|
|
|
#endif
|
|
|
|
|
@@ -197,8 +210,17 @@ Error TLSContextMbedTLS::init_client(int p_transport, const String &p_hostname,
|
|
|
}
|
|
|
|
|
|
#if MBEDTLS_VERSION_MAJOR >= 3
|
|
|
- if (Engine::get_singleton()->is_editor_hint() || !(bool)GLOBAL_GET("network/tls/enable_tls_v1.3")) {
|
|
|
- mbedtls_ssl_conf_max_tls_version(&conf, MBEDTLS_SSL_VERSION_TLS1_2);
|
|
|
+#ifdef TOOLS_ENABLED
|
|
|
+ if (Engine::get_singleton()->is_editor_hint()) {
|
|
|
+ if (!EditorSettings::get_singleton()->get_setting("network/tls/enable_tls_v1.3").operator bool()) {
|
|
|
+ mbedtls_ssl_conf_max_tls_version(&conf, MBEDTLS_SSL_VERSION_TLS1_2);
|
|
|
+ }
|
|
|
+ } else
|
|
|
+#endif
|
|
|
+ {
|
|
|
+ if (!GLOBAL_GET("network/tls/enable_tls_v1.3").operator bool()) {
|
|
|
+ mbedtls_ssl_conf_max_tls_version(&conf, MBEDTLS_SSL_VERSION_TLS1_2);
|
|
|
+ }
|
|
|
}
|
|
|
#endif
|
|
|
|