summaryrefslogtreecommitdiff
path: root/platform/web/export
diff options
context:
space:
mode:
Diffstat (limited to 'platform/web/export')
-rw-r--r--platform/web/export/editor_http_server.h38
-rw-r--r--platform/web/export/export.cpp10
-rw-r--r--platform/web/export/export_plugin.cpp28
-rw-r--r--platform/web/export/export_plugin.h2
4 files changed, 30 insertions, 48 deletions
diff --git a/platform/web/export/editor_http_server.h b/platform/web/export/editor_http_server.h
index 38b9a66d7e..fa0010ec8d 100644
--- a/platform/web/export/editor_http_server.h
+++ b/platform/web/export/editor_http_server.h
@@ -32,7 +32,7 @@
#define WEB_EDITOR_HTTP_SERVER_H
#include "core/io/image_loader.h"
-#include "core/io/stream_peer_ssl.h"
+#include "core/io/stream_peer_tls.h"
#include "core/io/tcp_server.h"
#include "core/io/zip_io.h"
#include "editor/editor_paths.h"
@@ -42,18 +42,18 @@ private:
Ref<TCPServer> server;
HashMap<String, String> mimes;
Ref<StreamPeerTCP> tcp;
- Ref<StreamPeerSSL> ssl;
+ Ref<StreamPeerTLS> tls;
Ref<StreamPeer> peer;
Ref<CryptoKey> key;
Ref<X509Certificate> cert;
- bool use_ssl = false;
+ bool use_tls = false;
uint64_t time = 0;
uint8_t req_buf[4096];
int req_pos = 0;
void _clear_client() {
peer = Ref<StreamPeer>();
- ssl = Ref<StreamPeerSSL>();
+ tls = Ref<StreamPeerTLS>();
tcp = Ref<StreamPeerTCP>();
memset(req_buf, 0, sizeof(req_buf));
time = 0;
@@ -98,19 +98,19 @@ public:
_clear_client();
}
- Error listen(int p_port, IPAddress p_address, bool p_use_ssl, String p_ssl_key, String p_ssl_cert) {
- use_ssl = p_use_ssl;
- if (use_ssl) {
+ Error listen(int p_port, IPAddress p_address, bool p_use_tls, String p_tls_key, String p_tls_cert) {
+ use_tls = p_use_tls;
+ if (use_tls) {
Ref<Crypto> crypto = Crypto::create();
if (crypto.is_null()) {
return ERR_UNAVAILABLE;
}
- if (!p_ssl_key.is_empty() && !p_ssl_cert.is_empty()) {
+ if (!p_tls_key.is_empty() && !p_tls_cert.is_empty()) {
key = Ref<CryptoKey>(CryptoKey::create());
- Error err = key->load(p_ssl_key);
+ Error err = key->load(p_tls_key);
ERR_FAIL_COND_V(err != OK, err);
cert = Ref<X509Certificate>(X509Certificate::create());
- err = cert->load(p_ssl_cert);
+ err = cert->load(p_tls_cert);
ERR_FAIL_COND_V(err != OK, err);
} else {
_set_internal_certs(crypto);
@@ -201,22 +201,22 @@ public:
return;
}
- if (use_ssl) {
- if (ssl.is_null()) {
- ssl = Ref<StreamPeerSSL>(StreamPeerSSL::create());
- peer = ssl;
- ssl->set_blocking_handshake_enabled(false);
- if (ssl->accept_stream(tcp, key, cert) != OK) {
+ if (use_tls) {
+ if (tls.is_null()) {
+ tls = Ref<StreamPeerTLS>(StreamPeerTLS::create());
+ peer = tls;
+ tls->set_blocking_handshake_enabled(false);
+ if (tls->accept_stream(tcp, key, cert) != OK) {
_clear_client();
return;
}
}
- ssl->poll();
- if (ssl->get_status() == StreamPeerSSL::STATUS_HANDSHAKING) {
+ tls->poll();
+ if (tls->get_status() == StreamPeerTLS::STATUS_HANDSHAKING) {
// Still handshaking, keep waiting.
return;
}
- if (ssl->get_status() != StreamPeerSSL::STATUS_CONNECTED) {
+ if (tls->get_status() != StreamPeerTLS::STATUS_CONNECTED) {
_clear_client();
return;
}
diff --git a/platform/web/export/export.cpp b/platform/web/export/export.cpp
index 3d40f2c10d..7193bc6ac4 100644
--- a/platform/web/export/export.cpp
+++ b/platform/web/export/export.cpp
@@ -36,12 +36,12 @@
void register_web_exporter() {
EDITOR_DEF("export/web/http_host", "localhost");
EDITOR_DEF("export/web/http_port", 8060);
- EDITOR_DEF("export/web/use_ssl", false);
- EDITOR_DEF("export/web/ssl_key", "");
- EDITOR_DEF("export/web/ssl_certificate", "");
+ EDITOR_DEF("export/web/use_tls", false);
+ EDITOR_DEF("export/web/tls_key", "");
+ EDITOR_DEF("export/web/tls_certificate", "");
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::INT, "export/web/http_port", PROPERTY_HINT_RANGE, "1,65535,1"));
- EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "export/web/ssl_key", PROPERTY_HINT_GLOBAL_FILE, "*.key"));
- EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "export/web/ssl_certificate", PROPERTY_HINT_GLOBAL_FILE, "*.crt,*.pem"));
+ EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "export/web/tls_key", PROPERTY_HINT_GLOBAL_FILE, "*.key"));
+ EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "export/web/tls_certificate", PROPERTY_HINT_GLOBAL_FILE, "*.crt,*.pem"));
Ref<EditorExportPlatformWeb> platform;
platform.instantiate();
diff --git a/platform/web/export/export_plugin.cpp b/platform/web/export/export_plugin.cpp
index 9971481459..306453c1eb 100644
--- a/platform/web/export/export_plugin.cpp
+++ b/platform/web/export/export_plugin.cpp
@@ -355,15 +355,6 @@ Ref<Texture2D> EditorExportPlatformWeb::get_logo() const {
}
bool EditorExportPlatformWeb::has_valid_export_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const {
-#ifndef DEV_ENABLED
- // We don't provide export templates for the Web platform currently as there
- // is no suitable renderer to use with them. So we forbid exporting and tell
- // users why. This is skipped in DEV_ENABLED so that contributors can still test
- // the pipeline once we start having WebGL or WebGPU support.
- r_error = "The Web platform is currently not supported in Godot 4.0, as there is no suitable renderer for it.\n";
- return false;
-#endif
-
String err;
bool valid = false;
bool extensions = (bool)p_preset->get("variant/extensions_support");
@@ -396,15 +387,6 @@ bool EditorExportPlatformWeb::has_valid_export_configuration(const Ref<EditorExp
}
bool EditorExportPlatformWeb::has_valid_project_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error) const {
-#ifndef DEV_ENABLED
- // We don't provide export templates for the Web platform currently as there
- // is no suitable renderer to use with them. So we forbid exporting and tell
- // users why. This is skipped in DEV_ENABLED so that contributors can still test
- // the pipeline once we start having WebGL or WebGPU support.
- r_error = "The Web platform is currently not supported in Godot 4.0, as there is no suitable renderer for it.\n";
- return false;
-#endif
-
String err;
bool valid = true;
@@ -633,23 +615,23 @@ Error EditorExportPlatformWeb::run(const Ref<EditorExportPreset> &p_preset, int
}
ERR_FAIL_COND_V_MSG(!bind_ip.is_valid(), ERR_INVALID_PARAMETER, "Invalid editor setting 'export/web/http_host': '" + bind_host + "'. Try using '127.0.0.1'.");
- const bool use_ssl = EDITOR_GET("export/web/use_ssl");
- const String ssl_key = EDITOR_GET("export/web/ssl_key");
- const String ssl_cert = EDITOR_GET("export/web/ssl_certificate");
+ const bool use_tls = EDITOR_GET("export/web/use_tls");
+ const String tls_key = EDITOR_GET("export/web/tls_key");
+ const String tls_cert = EDITOR_GET("export/web/tls_certificate");
// Restart server.
{
MutexLock lock(server_lock);
server->stop();
- err = server->listen(bind_port, bind_ip, use_ssl, ssl_key, ssl_cert);
+ err = server->listen(bind_port, bind_ip, use_tls, tls_key, tls_cert);
}
if (err != OK) {
add_message(EXPORT_MESSAGE_ERROR, TTR("Run"), vformat(TTR("Error starting HTTP server: %d."), err));
return err;
}
- OS::get_singleton()->shell_open(String((use_ssl ? "https://" : "http://") + bind_host + ":" + itos(bind_port) + "/tmp_js_export.html"));
+ OS::get_singleton()->shell_open(String((use_tls ? "https://" : "http://") + bind_host + ":" + itos(bind_port) + "/tmp_js_export.html"));
// FIXME: Find out how to clean up export files after running the successfully
// exported game. Might not be trivial.
return OK;
diff --git a/platform/web/export/export_plugin.h b/platform/web/export/export_plugin.h
index 5b7ce5f708..f11e38df09 100644
--- a/platform/web/export/export_plugin.h
+++ b/platform/web/export/export_plugin.h
@@ -33,7 +33,7 @@
#include "core/config/project_settings.h"
#include "core/io/image_loader.h"
-#include "core/io/stream_peer_ssl.h"
+#include "core/io/stream_peer_tls.h"
#include "core/io/tcp_server.h"
#include "core/io/zip_io.h"
#include "editor/editor_node.h"