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,15 +709,20 @@ SecureSocket::verifyCertFingerprint()
file.open(trustedServersFilename.c_str());
bool isValid = false;
while (!file.eof() && file.is_open()) {
getline(file,fileLine);
if (!fileLine.empty()) {
if (fileLine.compare(fingerprint) == 0) {
isValid = true;
break;
if (file.is_open()) {
while (!file.eof()) {
getline(file,fileLine);
if (!fileLine.empty()) {
if (fileLine.compare(fingerprint) == 0) {
isValid = true;
break;
}
}
}
}
else {
LOG((CLOG_ERR "Fail to open trusted fingerprints file: %s", trustedServersFilename.c_str()));
}
file.close();
return isValid;