Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Commit

Permalink
Bug 1302322 - Secure server-agent communication using sslsocket incor…
Browse files Browse the repository at this point in the history
…rectly requires a truststore password.

Made ClientSenderSecurityTruststorePassword(client.security.truststore.password) property optional, no longer
storing null in the configuration map. This avoids passing a map with nulls to org.jboss.remoting.Client which
causes an Exception on it's connect method.
  • Loading branch information
josejulio committed Feb 15, 2016
1 parent 6139191 commit bbb0359
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
package org.rhq.enterprise.agent;

import static java.util.concurrent.TimeUnit.SECONDS;
import gnu.getopt.Getopt;
import gnu.getopt.LongOpt;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
Expand Down Expand Up @@ -77,9 +75,6 @@
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;

import mazz.i18n.Logger;
import mazz.i18n.Msg;

import org.apache.log4j.Level;
import org.apache.log4j.LogManager;
import org.apache.log4j.xml.DOMConfigurator;
Expand All @@ -94,6 +89,7 @@
import org.jboss.remoting.security.SSLSocketBuilder;
import org.jboss.remoting.transport.http.ssl.HTTPSClientInvoker;
import org.jboss.util.file.FilenameSuffixFilter;

import org.rhq.core.clientapi.agent.lifecycle.PluginContainerLifecycle;
import org.rhq.core.clientapi.server.bundle.BundleServerService;
import org.rhq.core.clientapi.server.configuration.ConfigurationServerService;
Expand Down Expand Up @@ -189,6 +185,11 @@
import org.rhq.enterprise.communications.util.NotProcessedException;
import org.rhq.enterprise.communications.util.SecurityUtil;

import gnu.getopt.Getopt;
import gnu.getopt.LongOpt;
import mazz.i18n.Logger;
import mazz.i18n.Msg;

/**
* The main class of the agent runtime container.
*
Expand Down Expand Up @@ -2872,8 +2873,11 @@ private RemoteCommunicator createServerRemoteCommunicator(String uri, boolean wi
m_configuration.getClientSenderSecurityTruststoreAlgorithm());
config.put(SSLSocketBuilder.REMOTING_TRUST_STORE_TYPE,
m_configuration.getClientSenderSecurityTruststoreType());
config.put(SSLSocketBuilder.REMOTING_TRUST_STORE_PASSWORD,
m_configuration.getClientSenderSecurityTruststorePassword());
// ClientSenderSecurityTruststorePassword property is optional and should not be stored if null.
if (m_configuration.getClientSenderSecurityTruststorePassword() != null) {
config.put(SSLSocketBuilder.REMOTING_TRUST_STORE_PASSWORD,
m_configuration.getClientSenderSecurityTruststorePassword());
}
config.put(SSLSocketBuilder.REMOTING_SSL_PROTOCOL, m_configuration.getClientSenderSecuritySocketProtocol());
config.put(SSLSocketBuilder.REMOTING_KEY_ALIAS, m_configuration.getClientSenderSecurityKeystoreAlias());
config.put(SSLSocketBuilder.REMOTING_SERVER_AUTH_MODE,
Expand Down

0 comments on commit bbb0359

Please sign in to comment.