Configure HTTPS certificate via wizard

This commit is contained in:
Martchus 2023-09-04 20:34:38 +02:00
parent 669923dbb6
commit c811b06d6b
2 changed files with 7 additions and 2 deletions

View File

@ -665,6 +665,7 @@ void Connection::addConfigFromWizard(const Data::SyncthingConfig &config)
primary.password.clear();
primary.apiKey = apiKey;
primary.autoConnect = true; // ensure the connection is actually established when applying
primary.httpsCertPath = Data::SyncthingConfig::locateHttpsCertificate();
}
} // namespace Settings

View File

@ -64,8 +64,12 @@ void SetupDetection::restoreConfig()
void SetupDetection::initConnection()
{
connection.setSyncthingUrl(config.syncthingUrl());
connection.setApiKey(config.guiApiKey.toLocal8Bit());
auto settings = Data::SyncthingConnectionSettings();
settings.syncthingUrl = config.syncthingUrl();
settings.apiKey = config.guiApiKey.toLocal8Bit();
settings.httpsCertPath = certPath;
settings.loadHttpsCert();
connection.applySettings(settings);
}
bool SetupDetection::hasConfig() const