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.

(cherry picked from commit 64626f682e)
This commit is contained in:
Hein-Pieter van Braam-Stewart 2019-06-06 13:46:54 +00:00 committed by Rémi Verschelde
parent 19f132b368
commit 7592b3b9ee
1 changed files with 6 additions and 0 deletions

View File

@ -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
}