Skip to content

Commit

Permalink
fix issue #29: Dual SSL authentication - password fields are reversed
Browse files Browse the repository at this point in the history
  • Loading branch information
rende2005 committed Feb 27, 2018
1 parent f87e5a8 commit 98013ae
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions mqtt_jmeter/src/main/java/net/xmeter/gui/CommonConnUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class CommonConnUI implements ChangeListener, ActionListener, Constants{
private final JLabeledTextField certificationFilePath2 = new JLabeledTextField("Client Certification(*.p12):", 25);

private final JLabeledTextField tksPassword = new JLabeledTextField("Secret:", 10);
private final JLabeledTextField cksPassword = new JLabeledTextField("Secret:", 10);
private final JLabeledTextField ccPassword = new JLabeledTextField("Secret:", 10);

private JButton browse1;
private JButton browse2;
Expand Down Expand Up @@ -178,8 +178,8 @@ public JPanel createProtocolPanel() {

c.gridx = 3;
c.gridy = 1;
panel.add(cksPassword, c);
cksPassword.setVisible(false);
panel.add(ccPassword, c);
ccPassword.setVisible(false);

protocolPanel.add(pPanel);
protocolPanel.add(panel);
Expand Down Expand Up @@ -217,14 +217,14 @@ public void stateChanged(ChangeEvent e) {
certificationFilePath1.setVisible(true);
certificationFilePath2.setVisible(true);
tksPassword.setVisible(true);
cksPassword.setVisible(true);
ccPassword.setVisible(true);
browse1.setVisible(true);
browse2.setVisible(true);
} else {
certificationFilePath1.setVisible(false);
certificationFilePath2.setVisible(false);
tksPassword.setVisible(false);
cksPassword.setVisible(false);
ccPassword.setVisible(false);
browse1.setVisible(false);
browse2.setVisible(false);
}
Expand Down Expand Up @@ -265,7 +265,7 @@ public void configure(AbstractMQTTSampler sampler) {
dualAuth.setVisible(true);
dualAuth.setSelected(sampler.isDualSSLAuth());
}
cksPassword.setText(sampler.getKeyStorePassword());
ccPassword.setText(sampler.getKeyStorePassword());

if(sampler.getProtocol().trim().indexOf(JMETER_VARIABLE_PREFIX) == -1){
if(DEFAULT_PROTOCOL.equals(sampler.getProtocol())) {
Expand Down Expand Up @@ -303,8 +303,8 @@ public void setupSamplerProperties(AbstractMQTTSampler sampler) {
sampler.setConnReconnAttamptMax(reconnAttmptMax.getText());
sampler.setConnTimeout(timeout.getText());
sampler.setDualSSLAuth(dualAuth.isSelected());
sampler.setKeyStorePassword(cksPassword.getText());
sampler.setClientCertPassword(tksPassword.getText());
sampler.setKeyStorePassword(tksPassword.getText());
sampler.setClientCertPassword(ccPassword.getText());
sampler.setPort(serverPort.getText());
sampler.setProtocol(protocols.getText());
sampler.setServer(serverAddr.getText());
Expand All @@ -330,7 +330,7 @@ public void clearUI() {
connNamePrefix.setText(DEFAULT_CONN_PREFIX_FOR_CONN);
connShared.setSelected(DEFAULT_CONNECTION_SHARE);
protocols.setSelectedIndex(0);
cksPassword.setText("");
ccPassword.setText("");
reconnAttmptMax.setText(DEFAULT_CONN_RECONN_ATTAMPT_MAX);
serverAddr.setText(DEFAULT_SERVER);
serverPort.setText(DEFAULT_PORT);
Expand Down

0 comments on commit 98013ae

Please sign in to comment.