mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-22 02:06:31 +00:00
Fix tls handshaking issue (#20721)
* Fix tls handshaking issue * fixed time comparison issue * removed multiplication from loop
This commit is contained in:
parent
97821ab925
commit
c0ae3dcaca
@ -557,12 +557,18 @@ int WiFiClientSecure_light::_run_until(unsigned target, bool blocking) {
|
|||||||
DEBUG_BSSL("_run_until: Not connected\n");
|
DEBUG_BSSL("_run_until: Not connected\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
uint32_t t = millis();
|
||||||
for (int no_work = 0; blocking || no_work < 2;) {
|
for (int no_work = 0; blocking || no_work < 2;) {
|
||||||
if (blocking) {
|
if (blocking) {
|
||||||
// Only for blocking operations can we afford to yield()
|
// Only for blocking operations can we afford to yield()
|
||||||
optimistic_yield(100);
|
optimistic_yield(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (((int32_t)(millis() - (t + this->_loopTimeout)) >= 0)){
|
||||||
|
DEBUG_BSSL("_run_until: Timeout\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
int state;
|
int state;
|
||||||
state = br_ssl_engine_current_state(_eng);
|
state = br_ssl_engine_current_state(_eng);
|
||||||
if (state & BR_SSL_CLOSED) {
|
if (state & BR_SSL_CLOSED) {
|
||||||
|
@ -131,6 +131,7 @@ class WiFiClientSecure_light : public WiFiClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
uint32_t _loopTimeout=5000;
|
||||||
void _clear();
|
void _clear();
|
||||||
bool _ctx_present;
|
bool _ctx_present;
|
||||||
std::shared_ptr<br_ssl_client_context> _sc;
|
std::shared_ptr<br_ssl_client_context> _sc;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user