diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemosshthread.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemosshthread.cpp
index c3ce401ef42560b04c937ef1b61bce0b8f0f48b1..b43af146e291a807294fcc86f5408e29ab7105f0 100644
--- a/src/plugins/qt4projectmanager/qt-maemo/maemosshthread.cpp
+++ b/src/plugins/qt4projectmanager/qt-maemo/maemosshthread.cpp
@@ -41,6 +41,8 @@
 
 #include "maemosshthread.h"
 
+#include <exception>
+
 namespace Qt4ProjectManager {
 namespace Internal {
 
@@ -62,6 +64,10 @@ void MaemoSshThread::run()
             runInternal();
     } catch (const MaemoSshException &e) {
         m_error = e.error();
+    } catch (const std::exception &e) {
+        // Should in theory not be necessary, but Net7 leaks Botan exceptions.
+        m_error = tr("Error in cryptography backend: ")
+                  + QLatin1String(e.what());
     }
 }