dbhub: Use certificate manager to get client cert for authentication

When trying to fetch a database don't load a hardcoded client
certificate but grab one from the certificate manager in the preferences
dialog.

Also add support for password protected private keys.

Note: Since this is all testing code on the front-end side, we just use
the first certificate in case multiple certificates are configured.
This commit is contained in:
Martin Kleusberg
2016-11-06 14:50:27 +01:00
parent 982e4c4d34
commit eeeec5f2fc
3 changed files with 36 additions and 14 deletions

View File

@@ -2145,7 +2145,8 @@ void MainWindow::on_actionOpen_Remote_triggered()
QString url = QInputDialog::getText(this, qApp->applicationName(), tr("Please enter the URL of the database file to open."));
if(!url.isEmpty())
{
m_remoteDb.fetchDatabase(url);
QStringList certs = Settings::getSettingsValue("remote", "client_certificates").toStringList();
m_remoteDb.fetchDatabase(url, (certs.size() ? certs.at(0) : ""));
}
}