LibTLS: Avoid busy-wait between ClientHello and ServerHello

This commit also adds a timeout timer to cancel the connection if the
server does not respond to the hello request in 10 seconds.
This commit is contained in:
AnotherTest 2020-05-30 19:53:07 +04:30 committed by Andreas Kling
commit d54d2892a9
Notes: sideshowbarker 2024-07-19 05:56:33 +09:00
5 changed files with 52 additions and 15 deletions

View file

@ -167,4 +167,11 @@ ByteBuffer TLSv12::build_finished()
return packet;
}
void TLSv12::alert(AlertLevel level, AlertDescription code)
{
auto the_alert = build_alert(level == AlertLevel::Critical, (u8)code);
write_packet(the_alert);
flush();
}
}