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
1 changed files with 10 additions and 0 deletions
|
@ -1110,6 +1110,16 @@ public class SettingsImporter {
|
|||
|
||||
private static ConnectionSecurity convertConnectionSecurity(String connectionSecurity) {
|
||||
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);
|
||||
} catch (Exception e) {
|
||||
return ConnectionSecurity.NONE;
|
||||
|
|
Loading…
Reference in a new issue