1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 12:55:09 +00:00

LibTLS: Make enough stuff work to have a demo run

...maybe, sometimes :^)
This commit is contained in:
AnotherTest 2020-04-21 01:57:23 +04:30 committed by Andreas Kling
parent 7670e5ccf0
commit 72d56b46b5
5 changed files with 2274 additions and 2 deletions

View file

@ -211,8 +211,20 @@ void HttpsJob::start()
#endif
on_socket_connected();
};
m_socket->on_tls_error = [&](auto) {
finish_up();
m_socket->on_tls_error = [&](TLS::AlertDescription error) {
if (error == TLS::AlertDescription::HandshakeFailure) {
deferred_invoke([this](auto&) {
return did_fail(Core::NetworkJob::Error::ProtocolFailed);
});
} else if (error == TLS::AlertDescription::DecryptError) {
deferred_invoke([this](auto&) {
return did_fail(Core::NetworkJob::Error::ConnectionFailed);
});
} else {
deferred_invoke([this](auto&) {
return did_fail(Core::NetworkJob::Error::TransmissionFailed);
});
}
};
m_socket->on_tls_finished = [&] {
finish_up();