diff options
| author | Rémi Verschelde | 2018-04-03 23:14:01 +0200 |
|---|---|---|
| committer | GitHub | 2018-04-03 23:14:01 +0200 |
| commit | 1710582473330dc6e7758953e3378187b5e3f226 (patch) | |
| tree | 7dc769e2f23c15c639129845882e308ea3b0b430 /modules/websocket/websocket_client.cpp | |
| parent | 60d89d0ab315d957bb858eecb5c8b837eb160fa1 (diff) | |
| parent | 2e078142a0803ee5b411959734f857fbac666951 (diff) | |
| download | godot-1710582473330dc6e7758953e3378187b5e3f226.tar.gz godot-1710582473330dc6e7758953e3378187b5e3f226.tar.zst godot-1710582473330dc6e7758953e3378187b5e3f226.zip | |
Merge pull request #17847 from Faless/lws_update
LWS v2.4.2, mbedTLS v2.8.0, Websocket SSL support
Diffstat (limited to 'modules/websocket/websocket_client.cpp')
| -rw-r--r-- | modules/websocket/websocket_client.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/websocket/websocket_client.cpp b/modules/websocket/websocket_client.cpp index 591d9510c..770116308 100644 --- a/modules/websocket/websocket_client.cpp +++ b/modules/websocket/websocket_client.cpp @@ -32,6 +32,8 @@ GDCINULL(WebSocketClient); WebSocketClient::WebSocketClient() { + + verify_ssl = true; } WebSocketClient::~WebSocketClient() { @@ -72,6 +74,16 @@ Error WebSocketClient::connect_to_url(String p_url, PoolVector<String> p_protoco return connect_to_host(host, path, port, ssl, p_protocols); } +void WebSocketClient::set_verify_ssl_enabled(bool p_verify_ssl) { + + verify_ssl = p_verify_ssl; +} + +bool WebSocketClient::is_verify_ssl_enabled() const { + + return verify_ssl; +} + bool WebSocketClient::is_server() const { return false; @@ -116,6 +128,10 @@ void WebSocketClient::_on_error() { void WebSocketClient::_bind_methods() { ClassDB::bind_method(D_METHOD("connect_to_url", "url", "protocols", "gd_mp_api"), &WebSocketClient::connect_to_url, DEFVAL(PoolVector<String>()), DEFVAL(false)); ClassDB::bind_method(D_METHOD("disconnect_from_host"), &WebSocketClient::disconnect_from_host); + ClassDB::bind_method(D_METHOD("set_verify_ssl_enabled", "enabled"), &WebSocketClient::set_verify_ssl_enabled); + ClassDB::bind_method(D_METHOD("is_verify_ssl_enabled"), &WebSocketClient::is_verify_ssl_enabled); + + ADD_PROPERTYNZ(PropertyInfo(Variant::BOOL, "verify_ssl", PROPERTY_HINT_NONE, "", 0), "set_verify_ssl_enabled", "is_verify_ssl_enabled"); ADD_SIGNAL(MethodInfo("data_received")); ADD_SIGNAL(MethodInfo("connection_established", PropertyInfo(Variant::STRING, "protocol"))); |
