Skip to content

Commit

Permalink
Fix for empty parameters (#76)
Browse files Browse the repository at this point in the history
* Don't add empty parameters to container cmd

* Set public version
  • Loading branch information
mmaehren authored Jul 15, 2022
1 parent d15546d commit 9b09379
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>TLS-Docker-Library</artifactId>
<groupId>de.rub.nds.tlsdockerlib</groupId>
<version>2.1-SNAPSHOT</version>
<version>2.0.1</version>
<packaging>jar</packaging>

<developers>
Expand Down
23 changes: 13 additions & 10 deletions src/main/java/de/rub/nds/tls/subject/params/ParameterProfile.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,19 +96,22 @@ public String[] toParameters(String host, Integer targetPort, ImageProperties im
StringBuilder finalParams = new StringBuilder();
for (Parameter param : parameterList) {
if (supportsInsecure()) {
if (insecureConnection) {
// do not add CA param if we use insecure
if (param.getType() == ParameterType.CA_CERTIFICATE)
continue;
} else {
// do not add insecure if not wanted
if (param.getType() == ParameterType.INSECURE)
continue;
if ((insecureConnection && param.getType() == ParameterType.CA_CERTIFICATE)
|| (!insecureConnection && param.getType() == ParameterType.INSECURE)) {
// do not add CA param if we use insecure, do not add insecure
// if not wanted
continue;
}
}
// do not add parallelize if not wanted
if (!parallelize && param.getType() == ParameterType.PARALLELIZE)

if (!parallelize && param.getType() == ParameterType.PARALLELIZE) {
// do not add parallelize if not wanted
continue;
}
if (param.getCmdParameter().equals("")) {
// do not add empty commands that cause a blank space
continue;
}
finalParams.append(param.getCmdParameter());
finalParams.append(" ");
}
Expand Down

0 comments on commit 9b09379

Please sign in to comment.