Skip to content

Commit 9b09379

Browse files
authored
Fix for empty parameters (#76)
* Don't add empty parameters to container cmd * Set public version
1 parent d15546d commit 9b09379

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55
<artifactId>TLS-Docker-Library</artifactId>
66
<groupId>de.rub.nds.tlsdockerlib</groupId>
7-
<version>2.1-SNAPSHOT</version>
7+
<version>2.0.1</version>
88
<packaging>jar</packaging>
99

1010
<developers>

src/main/java/de/rub/nds/tls/subject/params/ParameterProfile.java

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -96,19 +96,22 @@ public String[] toParameters(String host, Integer targetPort, ImageProperties im
9696
StringBuilder finalParams = new StringBuilder();
9797
for (Parameter param : parameterList) {
9898
if (supportsInsecure()) {
99-
if (insecureConnection) {
100-
// do not add CA param if we use insecure
101-
if (param.getType() == ParameterType.CA_CERTIFICATE)
102-
continue;
103-
} else {
104-
// do not add insecure if not wanted
105-
if (param.getType() == ParameterType.INSECURE)
106-
continue;
99+
if ((insecureConnection && param.getType() == ParameterType.CA_CERTIFICATE)
100+
|| (!insecureConnection && param.getType() == ParameterType.INSECURE)) {
101+
// do not add CA param if we use insecure, do not add insecure
102+
// if not wanted
103+
continue;
107104
}
108105
}
109-
// do not add parallelize if not wanted
110-
if (!parallelize && param.getType() == ParameterType.PARALLELIZE)
106+
107+
if (!parallelize && param.getType() == ParameterType.PARALLELIZE) {
108+
// do not add parallelize if not wanted
109+
continue;
110+
}
111+
if (param.getCmdParameter().equals("")) {
112+
// do not add empty commands that cause a blank space
111113
continue;
114+
}
112115
finalParams.append(param.getCmdParameter());
113116
finalParams.append(" ");
114117
}

0 commit comments

Comments
 (0)