SYNERGY-1057 Add trace if the system can't open file with trusted fingerprints

This commit is contained in:
Serhii Hadzhilov 2021-08-27 15:18:09 +03:00
parent 7b2026e376
commit c5faa8de24

View file

@ -709,7 +709,8 @@ SecureSocket::verifyCertFingerprint()
file.open(trustedServersFilename.c_str()); file.open(trustedServersFilename.c_str());
bool isValid = false; bool isValid = false;
while (!file.eof() && file.is_open()) { if (file.is_open()) {
while (!file.eof()) {
getline(file,fileLine); getline(file,fileLine);
if (!fileLine.empty()) { if (!fileLine.empty()) {
if (fileLine.compare(fingerprint) == 0) { if (fileLine.compare(fingerprint) == 0) {
@ -718,6 +719,10 @@ SecureSocket::verifyCertFingerprint()
} }
} }
} }
}
else {
LOG((CLOG_ERR "Fail to open trusted fingerprints file: %s", trustedServersFilename.c_str()));
}
file.close(); file.close();
return isValid; return isValid;