Skip to content

Instantly share code, notes, and snippets.

@shalk
Created April 19, 2019 10:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shalk/6c80daa4b9042d726990680ac3b93e18 to your computer and use it in GitHub Desktop.
Save shalk/6c80daa4b9042d726990680ac3b93e18 to your computer and use it in GitHub Desktop.
//import org.apache.http.conn.ssl.SSLSocketFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
public class Test {
public static void main(String[] args) throws Exception {
SSLContext context = SSLContext.getInstance("TLS");
context.init(null, null, null);
SSLSocketFactory factory = context.getSocketFactory();
SSLSocket socket = (SSLSocket) factory.createSocket();
String[] protocols = socket.getSupportedProtocols();
System.out.println("Supported Protocols: " + protocols.length);
for (int i = 0; i < protocols.length; i++) {
System.out.println(" " + protocols[i]);
}
protocols = socket.getEnabledProtocols();
System.out.println("Enabled Protocols: " + protocols.length);
for (int i = 0; i < protocols.length; i++) {
System.out.println(" " + protocols[i]);
}
}
}
@shalk
Copy link
Author

shalk commented Apr 19, 2019

#!/bin/bash
# Author: shalk
# Created Time: Fri 19 Apr 2019 05:50:16 PM CST
# FileName: 1.sh
# Description:

for dir in `cat java.list`
do
  javac=$dir"javac"
  java=$dir"java"
  echo "--------------"
  echo  $(basename $(dirname $dir))
  echo -n `${javac} Test.java`
  echo `${java} Test`
  echo "--------------"
  echo ""
  echo ""
done

@shalk
Copy link
Author

shalk commented Apr 19, 2019

/opt/soft/jdk1.8.0/bin/
/opt/soft/openjdk8u202-b08/bin/
/opt/soft/jdk1.7.0_60/bin/
/opt/soft/jdk1.8.0_144/bin/
/opt/soft/jdk1.6.0_37/bin/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment