mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00: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
2 changed files with 13 additions and 4 deletions
|
@ -94,7 +94,7 @@ if (BUILD_LAGOM)
|
|||
target_link_libraries(test-crypto_lagom stdc++)
|
||||
add_test(
|
||||
NAME Crypto
|
||||
COMMAND test-crypto_lagom test -tc
|
||||
COMMAND test-crypto_lagom test -t -s google.com
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
|
|
|
@ -1730,8 +1730,17 @@ static void tls_test_client_hello()
|
|||
if (sent_request)
|
||||
return;
|
||||
sent_request = true;
|
||||
if (!tls.write("GET / HTTP/1.1\r\nHost: github.com\r\nConnection: close\r\n\r\n"_b)) {
|
||||
FAIL(write() failed);
|
||||
if (!tls.write("GET / HTTP/1.1\r\nHost: "_b)) {
|
||||
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);
|
||||
}
|
||||
};
|
||||
|
@ -1761,7 +1770,7 @@ static void tls_test_client_hello()
|
|||
FAIL(Connection failure);
|
||||
loop.quit(1);
|
||||
};
|
||||
if (!tls->connect("github.com", 443)) {
|
||||
if (!tls->connect(server ?: DEFAULT_SERVER, port)) {
|
||||
FAIL(connect() failed);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue