lib/net: Use fs::is_regular_file() to check for path existence

This commit is contained in:
Povilas Kanapickas 2021-11-01 04:29:52 +02:00
parent 220f9e8274
commit d033ffa3d8
1 changed files with 1 additions and 5 deletions

View File

@ -334,11 +334,7 @@ bool SecureSocket::loadCertificates(const std::string& filename)
return false;
}
else {
std::ifstream file(filename.c_str());
bool exist = file.good();
file.close();
if (!exist) {
if (!barrier::fs::is_regular_file(barrier::fs::u8path(filename))) {
showError("ssl certificate doesn't exist: " + filename);
return false;
}