LibTLS: Replace TLSv12 implementation with OpenSSL

This commit is contained in:
devgianlu
2025-02-14 09:49:33 +01:00
committed by Ali Mohammad Pur
parent d6e9d2cdbb
commit 7a38a3e994
15 changed files with 182 additions and 4709 deletions

View File

@@ -45,13 +45,8 @@ void WebSocketImplSerenity::connect(ConnectionInfo const& connection_info)
auto socket_result = [&]() -> ErrorOr<NonnullOwnPtr<Core::BufferedSocketBase>> {
auto host = connection_info.url().serialized_host().to_byte_string();
if (connection_info.is_secure()) {
TLS::Options options;
options.set_alert_handler([this](auto) {
on_connection_error();
});
return TRY(Core::BufferedSocket<TLS::TLSv12>::create(
TRY(TLS::TLSv12::connect(host, connection_info.url().port_or_default(), move(options)))));
TRY(TLS::TLSv12::connect(host, connection_info.url().port_or_default()))));
}
return TRY(Core::BufferedTCPSocket::create(
@@ -66,6 +61,7 @@ void WebSocketImplSerenity::connect(ConnectionInfo const& connection_info)
}
m_socket = socket_result.release_value();
MUST(m_socket->set_blocking(false));
m_socket->on_ready_to_read = [this] {
on_ready_to_read();