Skip to content

Commit

Permalink
GEODE-7414_2: modify init() method argument (apache#5040)
Browse files Browse the repository at this point in the history
  • Loading branch information
mivanac authored May 6, 2020
1 parent 536910a commit 5f9800b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,17 +216,17 @@ public void uncaughtException(final Thread thread, final Throwable throwable) {
}

public static class MySSLParameterExtension implements SSLParameterExtension {
DistributionConfig config;
Properties properties;

@Override
public void init(DistributionConfig config) {
this.config = config;
public void init(Properties properties) {
this.properties = properties;
}

@Override
public SSLParameters modifySSLClientSocketParameters(SSLParameters parameters) {
List<SNIServerName> serverNames = new ArrayList<>(1);
SNIHostName serverName = new SNIHostName(String.valueOf(config.getDistributedSystemId()));
SNIHostName serverName = new SNIHostName(properties.getProperty(DISTRIBUTED_SYSTEM_ID));
serverNames.add(serverName);
parameters.setServerNames(serverNames);
return parameters;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ public Builder setSSLParameterExtension(
this.sslParameterExtension = null;
return this;
}
sslParameterExtension.init(ids.getConfig());
sslParameterExtension.init(ids.getConfig().toProperties());
this.sslParameterExtension = sslParameterExtension;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

package org.apache.geode.net;

import javax.net.ssl.SSLParameters;
import java.util.Properties;

import org.apache.geode.distributed.internal.DistributionConfig;
import javax.net.ssl.SSLParameters;

/**
* User implementation of a SSLParameter extension logic.
Expand All @@ -29,9 +29,9 @@ public interface SSLParameterExtension {
/**
* Initialize the SSLParameterExtension.
*
* @param config the DistributionConfig
* @param properties the Properties
*/
default void init(DistributionConfig config) {}
default void init(Properties properties) {}

default SSLParameters modifySSLClientSocketParameters(SSLParameters parameters) {
return parameters;
Expand Down

0 comments on commit 5f9800b

Please sign in to comment.