TLS connections to the storage port on a node without server encryption configured causes java.io.IOException accessing missing keystore

patch by Jon Meredith; reviewed by David Capwell, Dinesh Joshi for CASSANDRA-16144
This commit is contained in:
Jon Meredith 2020-11-05 12:58:07 -08:00 committed by David Capwell
parent 140048f5b7
commit f293376aa8
2 changed files with 18 additions and 6 deletions

View File

@ -143,7 +143,9 @@ public class YamlConfigurationLoader implements ConfigurationLoader
return node;
}
});
return (T) constructor.getSingleData(klass);
T value = (T) constructor.getSingleData(klass);
propertiesChecker.check();
return value;
}
static class CustomConstructor extends CustomClassLoaderConstructor

View File

@ -57,6 +57,7 @@ public class InstanceConfig implements IInstanceConfig
public final UUID hostId;
public UUID hostId() { return hostId; }
private final Map<String, Object> params = new TreeMap<>();
private final Map<String, Object> dtestParams = new TreeMap<>();
private final EnumSet featureFlags;
@ -119,6 +120,7 @@ public class InstanceConfig implements IInstanceConfig
this.num = copy.num;
this.networkTopology = new NetworkTopology(copy.networkTopology);
this.params.putAll(copy.params);
this.dtestParams.putAll(copy.dtestParams);
this.hostId = copy.hostId;
this.featureFlags = copy.featureFlags;
this.broadcastAddressAndPort = copy.broadcastAddressAndPort;
@ -185,7 +187,7 @@ public class InstanceConfig implements IInstanceConfig
if (value == null)
value = NULL;
params.put(fieldName, value);
getParams(fieldName).put(fieldName, value);
return this;
}
@ -195,10 +197,18 @@ public class InstanceConfig implements IInstanceConfig
value = NULL;
// test value
params.put(fieldName, value);
getParams(fieldName).put(fieldName, value);
return this;
}
private Map<String, Object> getParams(String fieldName)
{
Map<String, Object> map = params;
if (fieldName.startsWith("dtest"))
map = dtestParams;
return map;
}
public void propagate(Object writeToConfig, Map<Class<?>, Function<Object, Object>> mapping)
{
throw new IllegalStateException("In-JVM dtests no longer support propagate");
@ -212,17 +222,17 @@ public class InstanceConfig implements IInstanceConfig
public Object get(String name)
{
return params.get(name);
return getParams(name).get(name);
}
public int getInt(String name)
{
return (Integer)params.get(name);
return (Integer) get(name);
}
public String getString(String name)
{
return (String)params.get(name);
return (String) get(name);
}
public Map<String, Object> getParams()