Skip to content
Snippets Groups Projects
Commit 554e1e8b authored by Robert Goldmann's avatar Robert Goldmann
Browse files

Fixed #255 - expired certificates are accepted

parent 11983b9c
No related branches found
No related tags found
No related merge requests found
...@@ -8,6 +8,8 @@ import java.io.PrintWriter; ...@@ -8,6 +8,8 @@ import java.io.PrintWriter;
import java.lang.reflect.Type; import java.lang.reflect.Type;
import java.net.URL; import java.net.URL;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.security.cert.CertificateExpiredException;
import java.security.cert.CertificateNotYetValidException;
import java.security.cert.X509Certificate; import java.security.cert.X509Certificate;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -59,8 +61,12 @@ public class ServerConnection ...@@ -59,8 +61,12 @@ public class ServerConnection
{ {
} }
public void checkServerTrusted(X509Certificate[] certs, String authType) public void checkServerTrusted(X509Certificate[] certs, String authType) throws CertificateExpiredException, CertificateNotYetValidException
{ {
for(X509Certificate currentCert : certs)
{
currentCert.checkValidity();
}
} }
} }; } };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment