24
24
25
25
import javax .swing .*;
26
26
import java .awt .*;
27
- import java .awt .event .ActionEvent ;
28
- import java .awt .event .ActionListener ;
29
-
30
27
import static java .awt .GridBagConstraints .*;
31
28
32
29
/**
@@ -49,7 +46,6 @@ public class SecurityLoginSettingsPanel extends JPanel
49
46
// Checkbox that toggles between 'old' style SSL (socket encryption, typically on port 5223), or STARTTLS. A check indicates 'old' behavior.
50
47
private JCheckBox useSSLBox ;
51
48
52
- private JCheckBox acceptAllCertificatesBox ;
53
49
private JCheckBox disableHostnameVerificationBox ;
54
50
55
51
public SecurityLoginSettingsPanel ( LocalPreferences localPreferences , JDialog optionsDialog )
@@ -73,15 +69,13 @@ public SecurityLoginSettingsPanel( LocalPreferences localPreferences, JDialog op
73
69
modeDisabledRadio .setToolTipText ( Res .getString ( "tooltip.encryptionmode.disabled" ) );
74
70
75
71
useSSLBox = new JCheckBox ();
76
- acceptAllCertificatesBox = new JCheckBox ();
77
72
disableHostnameVerificationBox = new JCheckBox ();
78
73
79
74
// .. Set labels/text for all the components.
80
75
ResourceUtils .resButton ( modeRequiredRadio , Res .getString ( "radio.encryptionmode.required" ) );
81
76
ResourceUtils .resButton ( modeIfPossibleRadio , Res .getString ( "radio.encryptionmode.ifpossible" ) );
82
77
ResourceUtils .resButton ( modeDisabledRadio , Res .getString ( "radio.encryptionmode.disabled" ) );
83
78
ResourceUtils .resButton ( useSSLBox , Res .getString ( "label.old.ssl" ) );
84
- ResourceUtils .resButton ( acceptAllCertificatesBox , Res .getString ( "checkbox.accept.all.certificates" ) );
85
79
ResourceUtils .resButton ( disableHostnameVerificationBox , Res .getString ( "checkbox.disable.hostname.verification" ) );
86
80
87
81
// ... add the radio buttons to a group to make them interdependent.
@@ -94,7 +88,6 @@ public SecurityLoginSettingsPanel( LocalPreferences localPreferences, JDialog op
94
88
modeDisabledRadio .addChangeListener ( e -> {
95
89
final boolean encryptionPossible = !modeDisabledRadio .isSelected ();
96
90
useSSLBox .setEnabled ( encryptionPossible );
97
- acceptAllCertificatesBox .setEnabled ( encryptionPossible );
98
91
disableHostnameVerificationBox .setEnabled ( encryptionPossible );
99
92
} );
100
93
@@ -103,7 +96,6 @@ public SecurityLoginSettingsPanel( LocalPreferences localPreferences, JDialog op
103
96
modeIfPossibleRadio .setSelected ( localPreferences .getSecurityMode () == ConnectionConfiguration .SecurityMode .ifpossible );
104
97
modeDisabledRadio .setSelected ( localPreferences .getSecurityMode () == ConnectionConfiguration .SecurityMode .disabled );
105
98
useSSLBox .setSelected ( localPreferences .isSSL () );
106
- acceptAllCertificatesBox .setSelected ( localPreferences .isAcceptAllCertificates () );
107
99
disableHostnameVerificationBox .setSelected ( localPreferences .isDisableHostnameVerification () );
108
100
109
101
// ... place the components on the titled-border panel.
@@ -116,8 +108,7 @@ public SecurityLoginSettingsPanel( LocalPreferences localPreferences, JDialog op
116
108
add ( encryptionModePanel , new GridBagConstraints ( 0 , 0 , 1 , 1 , 1.0 , 0.0 , NORTHWEST , HORIZONTAL , DEFAULT_INSETS , 0 , 0 ) );
117
109
118
110
// ... place the other components under the titled-border panel.
119
- add ( acceptAllCertificatesBox , new GridBagConstraints ( 0 , 1 , 1 , 1 , 0.0 , 0.0 , NORTHWEST , HORIZONTAL , DEFAULT_INSETS , 0 , 0 ) );
120
- add ( disableHostnameVerificationBox , new GridBagConstraints ( 0 , 2 , 1 , 1 , 0.0 , 1.0 , NORTHWEST , HORIZONTAL , DEFAULT_INSETS , 0 , 0 ) );
111
+ add ( disableHostnameVerificationBox , new GridBagConstraints ( 0 , 1 , 1 , 1 , 0.0 , 1.0 , NORTHWEST , HORIZONTAL , DEFAULT_INSETS , 0 , 0 ) );
121
112
}
122
113
123
114
public boolean validate_settings ()
@@ -140,7 +131,6 @@ public void saveSettings()
140
131
localPreferences .setSecurityMode ( ConnectionConfiguration .SecurityMode .disabled );
141
132
}
142
133
localPreferences .setSSL ( useSSLBox .isSelected () );
143
- localPreferences .setAcceptAllCertificates ( acceptAllCertificatesBox .isSelected () );
144
134
localPreferences .setDisableHostnameVerification ( disableHostnameVerificationBox .isSelected () );
145
135
SettingsManager .saveSettings ();
146
136
}
0 commit comments