Last active
April 3, 2025 12:44
-
-
Save rgpower/8a546cde0fca5fdec8389434fe44da59 to your computer and use it in GitHub Desktop.
Small utility to test Java truststore roots, easy to copy to a vm/container and run via "java -Djavax.ssl.trustStore... PKIX.java <URL>"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.net.*; | |
import java.io.*; | |
public class PKIX { | |
public static void main(String[] args) throws Exception { | |
URL u = new URL(args[0]); | |
URLConnection uc = u.openConnection(); | |
BufferedReader in = new BufferedReader(new InputStreamReader(uc.getInputStream())); | |
String inputLine; | |
while ((inputLine = in.readLine()) != null) | |
System.out.println(inputLine); | |
in.close(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment