Skip to content

Commit

Permalink
fix(vertx-node): use default values for array HttpServerConfiguraiton…
Browse files Browse the repository at this point in the history
… properties
  • Loading branch information
mariano-fernandez committed Mar 24, 2022
1 parent 5ad8f93 commit 40efd8b
Showing 1 changed file with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,10 @@ private List<CertificateOptions> getCertificateValues(String prefix) {
return certificates;
}

private List<String> getArrayValues(String prefix) {
private List<String> getArrayValues(
String prefix,
List<String> defaultValue
) {
final List<String> values = new ArrayList<>();

boolean found = true;
Expand All @@ -621,6 +624,10 @@ private List<String> getArrayValues(String prefix) {
}
}

if (values.isEmpty() && defaultValue != null) {
return defaultValue;
}

return values;
}

Expand Down Expand Up @@ -689,7 +696,10 @@ public HttpServerConfiguration build() {
this.keyStoreCertificates =
getCertificateValues(prefix + "ssl.keystore.certificates");
this.keyStoreKubernetes =
getArrayValues(prefix + "ssl.keystore.kubernetes");
getArrayValues(
prefix + "ssl.keystore.kubernetes",
this.keyStoreKubernetes
);
this.keyStoreDefaultAlias =
environment.getProperty(prefix + "ssl.keystore.defaultAlias");
this.keyStorePassword =
Expand All @@ -702,7 +712,8 @@ public HttpServerConfiguration build() {
environment.getProperty(prefix + "ssl.truststore.type", trustStoreType);
this.trustStorePath =
environment.getProperty(prefix + "ssl.truststore.path", trustStorePath);
this.trustStorePaths = getArrayValues(prefix + "ssl.truststore.path");
this.trustStorePaths =
getArrayValues(prefix + "ssl.truststore.path", this.trustStorePaths);
this.trustStorePassword =
environment.getProperty(
prefix + "ssl.truststore.password",
Expand Down

0 comments on commit 40efd8b

Please sign in to comment.