LibTLS: Streamline certificate loading

Some refactoring of our root ca loading process:

- Remove duplicate code
- Remove duplicate calls to `parse_root_ca`
- Load user imported certificates in Browser/RequestServer
This commit is contained in:
Fabian Dellwing 2023-04-10 07:06:17 +02:00 committed by Ali Mohammad Pur
parent e4481baef9
commit 93232d4e6d
Notes: sideshowbarker 2024-07-17 06:46:15 +09:00
5 changed files with 28 additions and 33 deletions

View file

@ -42,7 +42,7 @@ ErrorOr<Vector<Certificate>> load_certificates()
{
auto cacert_file = TRY(Core::File::open(locate_ca_certs_file(), Core::File::OpenMode::Read));
auto data = TRY(cacert_file->read_until_eof());
return TRY(DefaultRootCACertificates::the().reload_certificates(data));
return TRY(DefaultRootCACertificates::parse_pem_root_certificate_authorities(data));
}
TEST_CASE(test_TLS_hello_handshake)