Created
January 7, 2017 22:07
-
-
Save restfulhead/684d5b9aa8016c56a64246c4f3fca8a4 to your computer and use it in GitHub Desktop.
Test Java TLSv1.2 connection
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.*; | |
class Main { | |
public static void main(String[] args) throws Exception { | |
System.setProperty("https.protocols", "TLSv1.2"); | |
System.setProperty("javax.net.debug", "all"); | |
final URL url = new URL("https://your-server-to-test"); | |
try(final InputStream in = url.openStream()){ | |
//… | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment