Bill commented on a change in pull request #7366:
URL: https://github.com/apache/geode/pull/7366#discussion_r840115559
##########
File path:
geode-core/src/main/java/org/apache/geode/distributed/LocatorLauncher.java
##########
@@ -302,47 +304,79 @@ public void handleStop() {
public static LocatorStatusResponse statusLocator(int port, InetAddress
bindAddress)
throws IOException {
return statusLocator(port, bindAddress == null ? null :
bindAddress.getCanonicalHostName(),
- new Properties());
+ new DistributionConfigImpl(new Properties()));
}
/**
* Returns the status of the locator on the given host & port. If you have
endpoint
* identification enabled the preferred method is statusForLocator(int,
String), which
* lets you specify the locator's name that the locator has stored in its
TLS certificate
*/
- public LocatorStatusResponse statusForLocator(int port, InetAddress
bindAddress)
+ public LocatorStatusResponse statusForLocator(int port, InetAddress
bindAddressArg)
throws IOException {
- return statusLocator(port, bindAddress == null ? null :
bindAddress.getCanonicalHostName(),
- getProperties());
+ final String bindAddress =
+ bindAddressArg == null ? null : bindAddressArg.getCanonicalHostName();
+ final SSLConfig sslConfig = getSSLConfigurations(getLocator());
+ return getLocatorStatusResponse(port, bindAddress, sslConfig);
+ }
+
+ private SSLConfig getSSLConfigurations(Locator locator) {
+ final SSLConfig sslConfig;
+ if (locator == null) {
+ /*
+ * Locator is null in the case when a LocatorLauncher is created
+ * using its Builder but start is never called, hence no locator exists.
+ * Instead, this LocatorLauncher is used to get the status of the
+ * locator using PID, working dir etc.
+ * This is done in StatusLocatorCommand in gfsh
+ */
+ sslConfig = SSLConfigurationFactory.getSSLConfigForComponent(
+ getProperties(),
+ SecurableCommunicationChannel.LOCATOR);
+ } else {
+ /*
+ * If a locator is already present then the DistributedConfigImpl
+ * is not constructed again but rather taken from the locator properties.
+ * This will avoid reading the property files and possible old address
+ * verification error as those may not be valid anymore.
+ */
+ sslConfig = SSLConfigurationFactory.getSSLConfigForComponent(
+ ((InternalLocator) locator).getConfig(),
+ SecurableCommunicationChannel.LOCATOR);
+ }
+ return sslConfig;
Review comment:
alrighty
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]