diff options
| author | Rémi Verschelde <rverschelde@gmail.com> | 2023-05-12 23:26:43 +0200 |
|---|---|---|
| committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-05-12 23:26:43 +0200 |
| commit | 1c8b203f70042b4e8acd840662aad76a20a88ca0 (patch) | |
| tree | 9dc3b7bd79cb00f76170f7494b00d6a01b9e9739 /modules | |
| parent | 405aa3f2d6de7614d6dcf2d42bbff188a3e78ba4 (diff) | |
| parent | eeac6f8c7f070a9f4674bfa51ec35c57516311c0 (diff) | |
| download | redot-engine-1c8b203f70042b4e8acd840662aad76a20a88ca0.tar.gz | |
Merge pull request #77011 from Faless/tls/fix_crashes_when_unavailable
[TLS] Fix crashes trying to use TLS when not available.
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/websocket/wsl_peer.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/websocket/wsl_peer.cpp b/modules/websocket/wsl_peer.cpp index 816d5276b9..109d5102c3 100644 --- a/modules/websocket/wsl_peer.cpp +++ b/modules/websocket/wsl_peer.cpp @@ -332,7 +332,7 @@ void WSLPeer::_do_client_handshake() { if (connection == tcp) { // Start SSL handshake tls = Ref<StreamPeerTLS>(StreamPeerTLS::create()); - ERR_FAIL_COND_MSG(tls.is_null(), "SSL is not available in this build."); + ERR_FAIL_COND(tls.is_null()); if (tls->connect_to_stream(tcp, requested_host, tls_options) != OK) { close(-1); return; // Error. @@ -501,6 +501,8 @@ Error WSLPeer::connect_to_url(const String &p_url, Ref<TLSOptions> p_options) { path = "/"; } + ERR_FAIL_COND_V_MSG(use_tls && !StreamPeerTLS::is_available(), ERR_UNAVAILABLE, "WSS is not available in this build."); + requested_url = p_url; requested_host = host; |
