mirror of
https://github.com/moparisthebest/k-9
synced 2025-02-12 05:00:20 -05:00
Make sure settings import doesn't degrade connection security
Rewrite the now obsolete values "SSL_TLS_OPTIONAL" and "STARTTLS_OPTIONAL" to their "*_REQUIRED" counterparts before import.
This commit is contained in:
parent
0a63466704
commit
75fc76773d
@ -1110,6 +1110,16 @@ public class SettingsImporter {
|
|||||||
|
|
||||||
private static ConnectionSecurity convertConnectionSecurity(String connectionSecurity) {
|
private static ConnectionSecurity convertConnectionSecurity(String connectionSecurity) {
|
||||||
try {
|
try {
|
||||||
|
/*
|
||||||
|
* TODO:
|
||||||
|
* Add proper settings validation and upgrade capability for server settings.
|
||||||
|
* Once that exists, move this code into a SettingsUpgrader.
|
||||||
|
*/
|
||||||
|
if ("SSL_TLS_OPTIONAL".equals(connectionSecurity)) {
|
||||||
|
return ConnectionSecurity.SSL_TLS_REQUIRED;
|
||||||
|
} else if ("STARTTLS_OPTIONAL".equals(connectionSecurity)) {
|
||||||
|
return ConnectionSecurity.STARTTLS_REQUIRED;
|
||||||
|
}
|
||||||
return ConnectionSecurity.valueOf(connectionSecurity);
|
return ConnectionSecurity.valueOf(connectionSecurity);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return ConnectionSecurity.NONE;
|
return ConnectionSecurity.NONE;
|
||||||
|
Loading…
Reference in New Issue
Block a user