| 529 | } |
| 530 | |
| 531 | void Reseeder::LoadCertificates () |
| 532 | { |
| 533 | std::string certDir = i2p::fs::GetCertsDir() + i2p::fs::dirSep + "reseed"; |
| 534 | |
| 535 | std::vector<std::string> files; |
| 536 | int numCertificates = 0; |
| 537 | |
| 538 | if (!i2p::fs::ReadDir(certDir, files)) { |
| 539 | LogPrint(eLogWarning, "Reseed: Can't load reseed certificates from ", certDir); |
| 540 | return; |
| 541 | } |
| 542 | |
| 543 | for (const std::string & file : files) { |
| 544 | if (file.compare(file.size() - 4, 4, ".crt") != 0) { |
| 545 | LogPrint(eLogWarning, "Reseed: Ignoring file ", file); |
| 546 | continue; |
| 547 | } |
| 548 | LoadCertificate (file); |
| 549 | numCertificates++; |
| 550 | } |
| 551 | LogPrint (eLogInfo, "Reseed: ", numCertificates, " certificates loaded"); |
| 552 | } |
| 553 | |
| 554 | std::string Reseeder::HttpsRequest (const std::string& address) |
| 555 | { |