diff options
author | Hein-Pieter van Braam-Stewart <hp@tmm.cx> | 2019-06-06 13:46:54 +0000 |
---|---|---|
committer | Hein-Pieter van Braam-Stewart <hp@tmm.cx> | 2019-06-06 13:46:54 +0000 |
commit | 64626f682e41168a2973c5f23f35f5518c211864 (patch) | |
tree | 36afbc00b49a11bdcf777f769805bf8e5453d92c | |
parent | 197b65f32ac811f79bc5599fbfe8cf83914b6873 (diff) |
Fix a random SSL crash I saw once.
I don't know why this happened, I was debugging another issue. This
should take care of it though.
-rw-r--r-- | core/io/http_client.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp index ce2054db36..891fb7b0ca 100644 --- a/core/io/http_client.cpp +++ b/core/io/http_client.cpp @@ -346,6 +346,12 @@ Error HTTPClient::poll() { } else { // We are already handshaking, which means we can use your already active SSL connection ssl = static_cast<Ref<StreamPeerSSL> >(connection); + if (ssl.is_null()) { + close(); + status = STATUS_SSL_HANDSHAKE_ERROR; + return ERR_CANT_CONNECT; + } + ssl->poll(); // Try to finish the handshake } |