MCPcopy Create free account
hub / github.com/PurpleI2P/i2pd / LoadCertificates

Method LoadCertificates

libi2pd/Reseed.cpp:531–552  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 2

StartMethod · 0.45
ReseedMethod · 0.45

Calls 2

ReadDirFunction · 0.85
LogPrintFunction · 0.85

Tested by

no test coverage detected