mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-03 00:36:52 +03:00
Meta+Userland: Run the TLS test too
While this _does_ add a point of failure, it'll be a pretty bad day when google goes down. And this is unlikely to put a (positive) dent in their incoming requests, so let's just roll with it until we have our own TLS server.
This commit is contained in:
parent
c9f902d5de
commit
465d46c665
Notes:
sideshowbarker
2024-07-19 03:13:45 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/465d46c6654 Pull-request: https://github.com/SerenityOS/serenity/pull/3278 Issue: https://github.com/SerenityOS/serenity/issues/3273
@ -94,7 +94,7 @@ if (BUILD_LAGOM)
|
|||||||
target_link_libraries(test-crypto_lagom stdc++)
|
target_link_libraries(test-crypto_lagom stdc++)
|
||||||
add_test(
|
add_test(
|
||||||
NAME Crypto
|
NAME Crypto
|
||||||
COMMAND test-crypto_lagom test -tc
|
COMMAND test-crypto_lagom test -t -s google.com
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1730,8 +1730,17 @@ static void tls_test_client_hello()
|
|||||||
if (sent_request)
|
if (sent_request)
|
||||||
return;
|
return;
|
||||||
sent_request = true;
|
sent_request = true;
|
||||||
if (!tls.write("GET / HTTP/1.1\r\nHost: github.com\r\nConnection: close\r\n\r\n"_b)) {
|
if (!tls.write("GET / HTTP/1.1\r\nHost: "_b)) {
|
||||||
FAIL(write() failed);
|
FAIL(write(0) failed);
|
||||||
|
loop.quit(0);
|
||||||
|
}
|
||||||
|
auto* the_server = (const u8*)(server ?: DEFAULT_SERVER);
|
||||||
|
if (!tls.write(ByteBuffer::wrap(const_cast<u8*>(the_server), strlen((const char*)the_server)))) {
|
||||||
|
FAIL(write(1) failed);
|
||||||
|
loop.quit(0);
|
||||||
|
}
|
||||||
|
if (!tls.write("\r\nConnection : close\r\n\r\n"_b)) {
|
||||||
|
FAIL(write(2) failed);
|
||||||
loop.quit(0);
|
loop.quit(0);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -1761,7 +1770,7 @@ static void tls_test_client_hello()
|
|||||||
FAIL(Connection failure);
|
FAIL(Connection failure);
|
||||||
loop.quit(1);
|
loop.quit(1);
|
||||||
};
|
};
|
||||||
if (!tls->connect("github.com", 443)) {
|
if (!tls->connect(server ?: DEFAULT_SERVER, port)) {
|
||||||
FAIL(connect() failed);
|
FAIL(connect() failed);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user