summaryrefslogtreecommitdiff
path: root/Libraries/LibTLS/Handshake.cpp
diff options
context:
space:
mode:
authorAnotherTest <ali.mpfard@gmail.com>2020-05-30 19:53:07 +0430
committerAndreas Kling <kling@serenityos.org>2020-05-30 18:26:13 +0200
commitd54d2892a9bbf46adc3430871fb74502917f9ec3 (patch)
tree9904e43d8c8d9c6648a14195612390ba67f74c75 /Libraries/LibTLS/Handshake.cpp
parente5e8e8ab96c1489bb193236b9485e39d7b34b2a5 (diff)
downloadserenity-d54d2892a9bbf46adc3430871fb74502917f9ec3.zip
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.
Diffstat (limited to 'Libraries/LibTLS/Handshake.cpp')
-rw-r--r--Libraries/LibTLS/Handshake.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/Libraries/LibTLS/Handshake.cpp b/Libraries/LibTLS/Handshake.cpp
index e209f11d8a..99165fec5b 100644
--- a/Libraries/LibTLS/Handshake.cpp
+++ b/Libraries/LibTLS/Handshake.cpp
@@ -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();
+}
+
}