|
@@ -147,9 +147,11 @@ Error TLSContextMbedTLS::init_server(int p_transport, Ref<TLSOptions> p_options,
|
|
mbedtls_ssl_conf_dtls_cookies(&conf, mbedtls_ssl_cookie_write, mbedtls_ssl_cookie_check, &(cookies->cookie_ctx));
|
|
mbedtls_ssl_conf_dtls_cookies(&conf, mbedtls_ssl_cookie_write, mbedtls_ssl_cookie_check, &(cookies->cookie_ctx));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+#if MBEDTLS_VERSION_MAJOR >= 3
|
|
if (Engine::get_singleton()->is_editor_hint() || !(bool)GLOBAL_GET("network/tls/enable_tls_v1.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);
|
|
mbedtls_ssl_conf_max_tls_version(&conf, MBEDTLS_SSL_VERSION_TLS1_2);
|
|
}
|
|
}
|
|
|
|
+#endif
|
|
|
|
|
|
mbedtls_ssl_setup(&tls, &conf);
|
|
mbedtls_ssl_setup(&tls, &conf);
|
|
return OK;
|
|
return OK;
|
|
@@ -194,9 +196,11 @@ 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")) {
|
|
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);
|
|
mbedtls_ssl_conf_max_tls_version(&conf, MBEDTLS_SSL_VERSION_TLS1_2);
|
|
}
|
|
}
|
|
|
|
+#endif
|
|
|
|
|
|
// Set valid CAs
|
|
// Set valid CAs
|
|
mbedtls_ssl_conf_ca_chain(&conf, &(cas->cert), nullptr);
|
|
mbedtls_ssl_conf_ca_chain(&conf, &(cas->cert), nullptr);
|