1.使用HttpURLConnection发送请求
private static void trustAllCertificates(HttpURLConnection con) throws NoSuchAlgorithmException, KeyManagementException {((HttpsURLConnection) con).setHostnameVerifier(new HostnameVerifier() {public boolean verify(String ho…