Permalink
Browse files

Fix #886 (Unable to register due to certificate fingerprint mismatch) +

more verbose output
  • Loading branch information...
specing committed Sep 5, 2018
1 parent 7abd4fa commit 2a35eb8de5a900d41c579af5b91c0371417aefc8
Showing with 5 additions and 1 deletion.
  1. +3 −1 src/gui/ui.cpp
  2. +1 −0 src/servermanager.cpp
  3. +1 −0 src/socket.cpp
@@ -957,7 +957,9 @@ void Ui::OnInvalidFingerprintReceived(const std::string& fingerprint, const std:
if (expected_fingerprint.empty()) {
answer = customMessageBox(SL_MAIN_ICON, _("The certificate by the server is unkown. Do you want to trust it? Please verify the fingerprint:\n") + TowxString(fingerprint) , _("Unknown Certificate"), wxYES_NO | wxCANCEL);
} else {
answer = customMessageBox(SL_MAIN_ICON, _("The certificate by the server is invalid! Maybe there is a MITM ongoing. Do you want ignore this warning?:\n") + TowxString(fingerprint) , _("Unknown Certificate"), wxYES_NO | wxCANCEL);
answer = customMessageBox(SL_MAIN_ICON,
wxString::Format(_("The server provided an invalid certificate! Maybe there is a MITM attack ongoing. Do you want ignore this warning?\nExpected:\n%s\nReceived:\n%s"),
expected_fingerprint, fingerprint), _("Unknown Certificate"), wxYES_NO | wxCANCEL);
}
if (answer != wxYES) {
return;
@@ -99,6 +99,7 @@ void ServerManager::RegisterNewUser(const std::string& servername, const std::st
}
IServer::ServerLoginInfo info;
info.description = servername;
info.fingerprint = sett().GetServerFingerprint(servername);
info.hostname = STD_STRING(sett().GetServerHost(servername));
info.port = sett().GetServerPort(servername);
info.username = username;
@@ -194,6 +194,7 @@ bool Socket::VerifyCertificate()
fingerprint += buf[1];
}
m_fingerprint = fingerprint;
wxLogMessage("Expecting fingerprint: %s", m_excepted_fingerprint.c_str());
wxLogMessage("Certificate fingerprint: %s", m_fingerprint.c_str());

const char* version = SSL_get_version(m_ssl);

0 comments on commit 2a35eb8

Please sign in to comment.