创建SSL上下文
/** 来 自 时 代 J a v a 公 众 号 - nowjava.com **/ import java.net.URL; import java.security.GeneralSecurityException; import java.security.SecureRandom; import javax.net.ssl.HostnameVerifier; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLSession; import javax.net.ssl.X509TrustManager; public class Main{ public static void main(String[] argv) throws Exception{ System.out.println(createSSLContext()); } public static SSLContext createSSLContext() throws GeneralSecurityException { SSLContext context = SSLContext.getInstance("TLS");/**来自 时代Java**/ context.init( null,