1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 21:07:34 +00:00

LibTLS: Check if certificate is self signed before importing it as CA

This commit is contained in:
Fabian Dellwing 2023-03-21 18:48:18 +01:00 committed by Ali Mohammad Pur
parent 114a383af3
commit ee0ae18386
2 changed files with 8 additions and 6 deletions

View file

@ -72,8 +72,11 @@ Vector<Certificate> load_certificates()
continue;
}
auto certificate = certificate_result.release_value();
if (certificate.is_certificate_authority)
if (certificate.is_certificate_authority && certificate.is_self_signed()) {
certificates.append(move(certificate));
} else {
dbgln("Skipped '{}' because it is not a valid root CA", certificate.subject_identifier_string());
}
}
return certificates;