workaround for potentially unusable SSL context

This commit is contained in:
John
2023-10-14 16:49:31 +02:00
parent 4c453a2354
commit ef8be0133d
+3
View File
@@ -241,6 +241,9 @@ SSLSocket* SSLSocket::connect(const string& host, const uint16_t& port, bool htt
} }
bio = BIO_new_ssl_connect(ctx); bio = BIO_new_ssl_connect(ctx);
if (isError("new_ssl_conn", bio != nullptr)) { if (isError("new_ssl_conn", bio != nullptr)) {
// in this case the ctx seems to be in an invalid state and it never comes out of that again on its own
SSL_CTX_free(ctx);
ctx = nullptr;
break; break;
} }
BIO_set_info_callback(bio, bioInfoCallback); BIO_set_info_callback(bio, bioInfoCallback);