Disable changing TLS if STS is enforced

This commit is contained in:
Pavel Djundik 2020-02-19 13:26:43 +02:00
parent d9985e7318
commit 568427ca98
2 changed files with 14 additions and 2 deletions

View File

@ -65,10 +65,18 @@
type="checkbox" type="checkbox"
name="tls" name="tls"
:checked="defaults.tls ? true : false" :checked="defaults.tls ? true : false"
:disabled="config.lockNetwork ? true : false" :disabled="
config.lockNetwork || defaults.hasSTSPolicy ? true : false
"
@change="onSecureChanged" @change="onSecureChanged"
/> />
Use secure connection (TLS) Use secure connection (TLS)
<span
v-if="defaults.hasSTSPolicy"
class="tooltipped tooltipped-n tooltipped-no-delay"
aria-label="This network has a strict transport security policy, you will be unable to disable TLS"
>🔒 STS</span
>
</label> </label>
<label class="tls"> <label class="tls">
<input <input

View File

@ -396,7 +396,11 @@ Network.prototype.exportForEdit = function() {
fieldsToReturn = ["name", "nick", "username", "password", "realname"]; fieldsToReturn = ["name", "nick", "username", "password", "realname"];
} }
return _.pick(this, fieldsToReturn); const data = _.pick(this, fieldsToReturn);
data.hasSTSPolicy = !!STSPolicies.get(this.host);
return data;
}; };
Network.prototype.export = function() { Network.prototype.export = function() {