}
AccountPtr account = _ocWizard->account();
account->setUrl(url);
+
// Reset the proxy which might had been determined previously in ConnectionValidator::checkServerAndAuth()
// when there was a previous account.
account->networkAccessManager()->setProxy(QNetworkProxy(QNetworkProxy::NoProxy));
+
// And also reset the QSslConfiguration, for the same reason (#6832)
- account->setSslConfiguration({});
+ // Here the client certificate is added, if any. Later it'll be in HttpCredentials
+ account->setSslConfiguration(QSslConfiguration());
+ auto sslConfiguration = account->getOrCreateSslConfig(); // let Account set defaults
+ if (!_ocWizard->_clientSslCertificate.isNull()) {
+ sslConfiguration.setLocalCertificate(_ocWizard->_clientSslCertificate);
+ sslConfiguration.setPrivateKey(_ocWizard->_clientSslKey);
+ }
+ // Be sure to merge the CAs
+ auto ca = sslConfiguration.systemCaCertificates();
+ ca.append(_ocWizard->_clientSslCaCertificates);
+ sslConfiguration.setCaCertificates(ca);
+ account->setSslConfiguration(sslConfiguration);
+
+ // Make sure TCP connections get re-established
+ account->networkAccessManager()->clearAccessCache();
// Lookup system proxy in a thread https://github.com/owncloud/client/issues/2993
if (ClientProxy::isUsingSystemDefault()) {
&_ocWizard->_clientSslCertificate,
&_ocWizard->_clientSslCaCertificates,
addCertDial->getCertificatePasswd().toLocal8Bit())) {
- AccountPtr acc = _ocWizard->account();
-
- // to re-create the session ticket because we added a key/cert
- acc->setSslConfiguration(QSslConfiguration());
- QSslConfiguration sslConfiguration = acc->getOrCreateSslConfig();
-
- // We're stuffing the certificate into the configuration form here. Later the
- // cert will come via the HttpCredentials
- sslConfiguration.setLocalCertificate(_ocWizard->_clientSslCertificate);
- sslConfiguration.setPrivateKey(_ocWizard->_clientSslKey);
-
- // Be sure to merge the CAs
- auto ca = sslConfiguration.systemCaCertificates();
- ca.append(_ocWizard->_clientSslCaCertificates);
- sslConfiguration.setCaCertificates(ca);
-
- acc->setSslConfiguration(sslConfiguration);
-
- // Make sure TCP connections get re-established
- acc->networkAccessManager()->clearAccessCache();
-
+ // The SSL cert gets added to the QSslConfiguration in checkServer()
addCertDial->reinit(); // FIXME: Why not just have this only created on use?
validatePage();
} else {