Created
July 12, 2018 22:06
-
-
Save msach22/6db08f728137ff19c9809ecebf479792 to your computer and use it in GitHub Desktop.
Run the following code to check your environment
This file contains 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.URL; | |
import java.net.HttpURLConnection; | |
import java.net.MalformedURLException; | |
import java.net.SocketException; | |
import java.io.IOException; | |
class TestTls { | |
public static void main(String[] args){ | |
URL url = null; | |
try { | |
url = new URL("https://preview.opentok.com/tls-check.json"); | |
HttpURLConnection connection = (HttpURLConnection) url.openConnection(); | |
connection.setRequestMethod("GET"); | |
connection.connect(); | |
System.out.println("Connection successfully established with your current TLS configuration, no further action required."); | |
} catch(MalformedURLException urlException) { | |
System.out.println("No legal protocol found in string or the URL could not be parsed."); | |
} catch(SocketException socketException){ | |
System.out.println("Failed to connect to OpenTok, please check your system and upgrade your environment as needed."); | |
} catch (IOException e) { | |
System.out.println("Unknown error talking to OpenTok, please try again later."); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment