Add comments

This commit is contained in:
2025-02-13 11:45:27 +01:00
parent 3d03a318e3
commit e1188e3178

View File

@@ -32,7 +32,7 @@ public class SSLCertChecker {
}
}
catch (IOException e){
System.out.println("Error reading file");
System.out.println("Error reading file"+e.getMessage());
}
}
public static void checkCert(String curl){
@@ -41,6 +41,8 @@ public class SSLCertChecker {
HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
connection.connect();
// Get the Cert Chain and check for every Certificate in the line
// First one is usually the own Cert, the ones after the CA
Certificate[] certs = connection.getServerCertificates();
for (Certificate cert : certs) {
if (cert instanceof X509Certificate) {
@@ -64,10 +66,15 @@ public class SSLCertChecker {
System.out.println("Fehler beim Abrufen des Zertifikats: " + e.getMessage());
}
}
//
// first args needs to be a file with the domains listed. Every domain needs to have its own line
//
public static void main(String[] args){
if(args.length <1)
if(args.length <1){
System.out.println("Kein Url-File angegeben");
readUrls(args[0]);
}
else
readUrls(args[0]);
}
}