Skip to content

Commit be98009

Browse files
committed
fixed a bug if a certificate was generally not trusted but the causes were deemed null
1 parent a943739 commit be98009

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,11 @@ public CertificateChain(Certificate certificate, String uri) {
201201
CertPathValidationResult certPathValidationResult = evaluateGeneralTrust(orderedCertificateChain);
202202
generallyTrusted = certPathValidationResult.isValid();
203203
if (!generallyTrusted) {
204-
CertPathValidationException[] causes = certPathValidationResult.getCauses();
205-
for (CertPathValidationException exception : causes) {
206-
exception.printStackTrace();
204+
if (certPathValidationResult.getCauses() != null) {
205+
CertPathValidationException[] causes = certPathValidationResult.getCauses();
206+
for (CertPathValidationException exception : causes) {
207+
exception.printStackTrace();
208+
}
207209
}
208210
}
209211
} else {

0 commit comments

Comments
 (0)