|
32 | 32 |
|
33 | 33 | #include "core/config/project_settings.h" |
34 | 34 |
|
| 35 | +#ifdef TOOLS_ENABLED |
| 36 | +#include "editor/editor_settings.h" |
| 37 | +#endif // TOOLS_ENABLED |
| 38 | + |
35 | 39 | static void my_debug(void *ctx, int level, |
36 | 40 | const char *file, int line, |
37 | 41 | const char *str) { |
@@ -148,8 +152,17 @@ Error TLSContextMbedTLS::init_server(int p_transport, Ref<TLSOptions> p_options, |
148 | 152 | } |
149 | 153 |
|
150 | 154 | #if MBEDTLS_VERSION_MAJOR >= 3 |
151 | | - if (Engine::get_singleton()->is_editor_hint() || !(bool)GLOBAL_GET("network/tls/enable_tls_v1.3")) { |
152 | | - mbedtls_ssl_conf_max_tls_version(&conf, MBEDTLS_SSL_VERSION_TLS1_2); |
| 155 | +#ifdef TOOLS_ENABLED |
| 156 | + if (Engine::get_singleton()->is_editor_hint()) { |
| 157 | + if (!EditorSettings::get_singleton()->get_setting("network/tls/enable_tls_v1.3").operator bool()) { |
| 158 | + mbedtls_ssl_conf_max_tls_version(&conf, MBEDTLS_SSL_VERSION_TLS1_2); |
| 159 | + } |
| 160 | + } else |
| 161 | +#endif |
| 162 | + { |
| 163 | + if (!GLOBAL_GET("network/tls/enable_tls_v1.3").operator bool()) { |
| 164 | + mbedtls_ssl_conf_max_tls_version(&conf, MBEDTLS_SSL_VERSION_TLS1_2); |
| 165 | + } |
153 | 166 | } |
154 | 167 | #endif |
155 | 168 |
|
@@ -197,8 +210,17 @@ Error TLSContextMbedTLS::init_client(int p_transport, const String &p_hostname, |
197 | 210 | } |
198 | 211 |
|
199 | 212 | #if MBEDTLS_VERSION_MAJOR >= 3 |
200 | | - if (Engine::get_singleton()->is_editor_hint() || !(bool)GLOBAL_GET("network/tls/enable_tls_v1.3")) { |
201 | | - mbedtls_ssl_conf_max_tls_version(&conf, MBEDTLS_SSL_VERSION_TLS1_2); |
| 213 | +#ifdef TOOLS_ENABLED |
| 214 | + if (Engine::get_singleton()->is_editor_hint()) { |
| 215 | + if (!EditorSettings::get_singleton()->get_setting("network/tls/enable_tls_v1.3").operator bool()) { |
| 216 | + mbedtls_ssl_conf_max_tls_version(&conf, MBEDTLS_SSL_VERSION_TLS1_2); |
| 217 | + } |
| 218 | + } else |
| 219 | +#endif |
| 220 | + { |
| 221 | + if (!GLOBAL_GET("network/tls/enable_tls_v1.3").operator bool()) { |
| 222 | + mbedtls_ssl_conf_max_tls_version(&conf, MBEDTLS_SSL_VERSION_TLS1_2); |
| 223 | + } |
202 | 224 | } |
203 | 225 | #endif |
204 | 226 |
|
|
0 commit comments