diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp index 3954f50f7a5..f2e8442df0a 100644 --- a/core/io/http_client.cpp +++ b/core/io/http_client.cpp @@ -100,6 +100,11 @@ void HTTPClient::set_connection(const Ref &p_connection) { ERR_FAIL_COND_MSG(p_connection.is_null(), "Connection is not a reference to a valid StreamPeer object."); + if (ssl) { + ERR_FAIL_NULL_MSG(Object::cast_to(p_connection.ptr()), + "Connection is not a reference to a valid StreamPeerSSL object."); + } + if (connection == p_connection) { return; }