Skip to content

Commit

Permalink
net: Always report the filename of the cert that fails to load
Browse files Browse the repository at this point in the history
  • Loading branch information
p12tic committed Jul 19, 2020
1 parent 3d01866 commit bd3a8be
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/net/SecureSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,19 +349,19 @@ bool SecureSocket::loadCertificates(const std::string& filename)
int r = 0;
r = SSL_CTX_use_certificate_file(m_ssl->m_context, filename.c_str(), SSL_FILETYPE_PEM);
if (r <= 0) {
showError("could not use ssl certificate");
showError("could not use ssl certificate: " + filename);
return false;
}

r = SSL_CTX_use_PrivateKey_file(m_ssl->m_context, filename.c_str(), SSL_FILETYPE_PEM);
if (r <= 0) {
showError("could not use ssl private key");
showError("could not use ssl private key: " + filename);
return false;
}

r = SSL_CTX_check_private_key(m_ssl->m_context);
if (!r) {
showError("could not verify ssl private key");
showError("could not verify ssl private key: " + filename);
return false;
}

Expand Down

0 comments on commit bd3a8be

Please sign in to comment.