diff options
Diffstat (limited to 'platform/web')
-rw-r--r-- | platform/web/export/editor_http_server.h | 36 | ||||
-rw-r--r-- | platform/web/export/export.cpp | 10 | ||||
-rw-r--r-- | platform/web/export/export_plugin.cpp | 10 | ||||
-rw-r--r-- | platform/web/http_client_web.cpp | 6 | ||||
-rw-r--r-- | platform/web/http_client_web.h | 2 |
5 files changed, 32 insertions, 32 deletions
diff --git a/platform/web/export/editor_http_server.h b/platform/web/export/editor_http_server.h index d0e23b1a77..fa0010ec8d 100644 --- a/platform/web/export/editor_http_server.h +++ b/platform/web/export/editor_http_server.h @@ -42,18 +42,18 @@ private: Ref<TCPServer> server; HashMap<String, String> mimes; Ref<StreamPeerTCP> tcp; - Ref<StreamPeerTLS> 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<StreamPeerTLS>(); + 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<StreamPeerTLS>(StreamPeerTLS::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() == StreamPeerTLS::STATUS_HANDSHAKING) { + tls->poll(); + if (tls->get_status() == StreamPeerTLS::STATUS_HANDSHAKING) { // Still handshaking, keep waiting. return; } - if (ssl->get_status() != StreamPeerTLS::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 a2425c1500..306453c1eb 100644 --- a/platform/web/export/export_plugin.cpp +++ b/platform/web/export/export_plugin.cpp @@ -615,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/http_client_web.cpp b/platform/web/http_client_web.cpp index bfdea95f4a..d045275826 100644 --- a/platform/web/http_client_web.cpp +++ b/platform/web/http_client_web.cpp @@ -37,14 +37,14 @@ void HTTPClientWeb::_parse_headers(int p_len, const char **p_headers, void *p_re } } -Error HTTPClientWeb::connect_to_host(const String &p_host, int p_port, bool p_ssl, bool p_verify_host) { +Error HTTPClientWeb::connect_to_host(const String &p_host, int p_port, bool p_tls, bool p_verify_host) { close(); - if (p_ssl && !p_verify_host) { + if (p_tls && !p_verify_host) { WARN_PRINT("Disabling HTTPClientWeb's host verification is not supported for the Web platform, host will be verified"); } port = p_port; - use_tls = p_ssl; + use_tls = p_tls; host = p_host; diff --git a/platform/web/http_client_web.h b/platform/web/http_client_web.h index ff776d72af..5059b4693e 100644 --- a/platform/web/http_client_web.h +++ b/platform/web/http_client_web.h @@ -86,7 +86,7 @@ public: Error request(Method p_method, const String &p_url, const Vector<String> &p_headers, const uint8_t *p_body, int p_body_size) override; - Error connect_to_host(const String &p_host, int p_port = -1, bool p_ssl = false, bool p_verify_host = true) override; + Error connect_to_host(const String &p_host, int p_port = -1, bool p_tls = false, bool p_verify_host = true) override; void set_connection(const Ref<StreamPeer> &p_connection) override; Ref<StreamPeer> get_connection() const override; void close() override; |