Skip to content

Commit a111439

Browse files
authored
Merge pull request #61 from RUB-NDS/certificatePathValidationResultCausesBug
Certificate path validation bugfix
2 parents a943739 + d042ca1 commit a111439

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<artifactId>TLS-Scanner</artifactId>
55
<groupId>de.rub.nds.tlsscanner</groupId>
6-
<version>2.11</version>
6+
<version>2.11.1</version>
77
<packaging>jar</packaging>
88
<dependencies>
99
<dependency>
@@ -40,13 +40,13 @@
4040
<dependency>
4141
<groupId>com.fasterxml.jackson.core</groupId>
4242
<artifactId>jackson-databind</artifactId>
43-
<version>2.9.8</version>
43+
<version>2.10.0</version>
4444
<type>jar</type>
4545
</dependency>
4646
<dependency>
4747
<groupId>com.fasterxml.jackson.dataformat</groupId>
4848
<artifactId>jackson-dataformat-yaml</artifactId>
49-
<version>2.9.8</version>
49+
<version>2.10.0</version>
5050
</dependency>
5151
<dependency>
5252
<groupId>org.apache.commons</groupId>

src/main/java/de/rub/nds/tlsscanner/probe/certificate/CertificateChain.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,10 @@ public CertificateChain(Certificate certificate, String uri) {
202202
generallyTrusted = certPathValidationResult.isValid();
203203
if (!generallyTrusted) {
204204
CertPathValidationException[] causes = certPathValidationResult.getCauses();
205-
for (CertPathValidationException exception : causes) {
206-
exception.printStackTrace();
205+
if (causes != null) {
206+
for (CertPathValidationException exception : causes) {
207+
exception.printStackTrace();
208+
}
207209
}
208210
}
209211
} else {

src/main/java/de/rub/nds/tlsscanner/trust/TrustAnchorManager.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import java.util.LinkedList;
3131
import java.util.List;
3232
import java.util.Set;
33+
import java.util.TreeSet;
3334
import javax.security.auth.x500.X500Principal;
3435
import org.apache.logging.log4j.LogManager;
3536
import org.apache.logging.log4j.Logger;
@@ -135,7 +136,7 @@ private Set<TrustAnchor> getFullTrustAnchorSet() {
135136
} catch (IOException | NoSuchAlgorithmException | CertificateException | KeyStoreException | InvalidAlgorithmParameterException ex) {
136137
LOGGER.error("Could not build TrustAnchorSet", ex);
137138
}
138-
return null;
139+
return new HashSet<>();
139140
}
140141

141142
public Set<TrustAnchor> getTrustAnchorSet() {

0 commit comments

Comments
 (0)