Add config option to disable tls validation
This commit is contained in:
parent
973ec13ad8
commit
47e97d490c
7 changed files with 42 additions and 4 deletions
|
|
@ -119,6 +119,9 @@ UserSettings::load(std::optional<QString> profile)
|
|||
userId_ = settings.value(prefix + "auth/user_id", "").toString();
|
||||
deviceId_ = settings.value(prefix + "auth/device_id", "").toString();
|
||||
|
||||
disableCertificateValidation_ =
|
||||
settings.value("disable_certificate_validation", false).toBool();
|
||||
|
||||
applyTheme();
|
||||
}
|
||||
void
|
||||
|
|
@ -526,6 +529,17 @@ UserSettings::setHomeserver(QString homeserver)
|
|||
save();
|
||||
}
|
||||
|
||||
void
|
||||
UserSettings::setDisableCertificateValidation(bool disabled)
|
||||
{
|
||||
if (disabled == disableCertificateValidation_)
|
||||
return;
|
||||
disableCertificateValidation_ = disabled;
|
||||
http::client()->verify_certificates(!disabled);
|
||||
emit disableCertificateValidationChanged(disabled);
|
||||
save();
|
||||
}
|
||||
|
||||
void
|
||||
UserSettings::applyTheme()
|
||||
{
|
||||
|
|
@ -641,6 +655,8 @@ UserSettings::save()
|
|||
settings.setValue(prefix + "auth/user_id", userId_);
|
||||
settings.setValue(prefix + "auth/device_id", deviceId_);
|
||||
|
||||
settings.setValue("disable_certificate_validation", disableCertificateValidation_);
|
||||
|
||||
settings.sync();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue