mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
Meta+RequestServer: Remove local download of ca-certificates
We haven't required a local copy of the ca-certificates since switching to OpenSSL as the backend for TLS. Remove the script to download the PEM file, and update the tests to use the system's CA certificates.
This commit is contained in:
parent
12dd5f0804
commit
ffd600a7f5
Notes:
github-actions[bot]
2025-07-07 07:11:32 +00:00
Author: https://github.com/ADKaster
Commit: ffd600a7f5
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5326
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/gmta ✅
12 changed files with 7 additions and 134 deletions
|
@ -11,11 +11,9 @@
|
|||
#include <LibCore/Timer.h>
|
||||
#include <LibCrypto/ASN1/ASN1.h>
|
||||
#include <LibCrypto/ASN1/PEM.h>
|
||||
#include <LibFileSystem/FileSystem.h>
|
||||
#include <LibTLS/TLSv12.h>
|
||||
#include <LibTest/TestCase.h>
|
||||
|
||||
static StringView ca_certs_file = "./cacert.pem"sv;
|
||||
static int port = 443;
|
||||
|
||||
constexpr auto DEFAULT_SERVER = "www.google.com"sv;
|
||||
|
@ -25,24 +23,11 @@ static ByteBuffer operator""_b(char const* string, size_t length)
|
|||
return ByteBuffer::copy(string, length).release_value();
|
||||
}
|
||||
|
||||
static Optional<ByteString> locate_ca_certs_file()
|
||||
{
|
||||
if (FileSystem::exists(ca_certs_file)) {
|
||||
return ca_certs_file;
|
||||
}
|
||||
auto on_target_path = ByteString("/etc/cacert.pem");
|
||||
if (FileSystem::exists(on_target_path)) {
|
||||
return on_target_path;
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
TEST_CASE(test_TLS_hello_handshake)
|
||||
{
|
||||
Core::EventLoop loop;
|
||||
|
||||
TLS::Options options;
|
||||
options.root_certificates_path = locate_ca_certs_file();
|
||||
TLS::Options options = {};
|
||||
|
||||
auto tls = TRY_OR_FAIL(Core::BufferedSocket<TLS::TLSv12>::create(TRY_OR_FAIL(TLS::TLSv12::connect(DEFAULT_SERVER, port, move(options)))));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue