From 75b6a578450112d5bee57673af793ea1ab483086 Mon Sep 17 00:00:00 2001 From: qi Date: Thu, 14 May 2020 16:31:03 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=88=A0=E9=99=A4=E6=B5=8B=E8=AF=95=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=202.=E6=96=B0=E5=A2=9E=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/lq/code/util/HttpsClient.java | 28 +++---------------- 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/src/main/java/com/lq/code/util/HttpsClient.java b/src/main/java/com/lq/code/util/HttpsClient.java index 42b4b4f..2137a36 100755 --- a/src/main/java/com/lq/code/util/HttpsClient.java +++ b/src/main/java/com/lq/code/util/HttpsClient.java @@ -22,6 +22,10 @@ import java.util.HashMap; import java.util.Map; import java.util.UUID; +/** + * https 客户端 + * @author qi + */ public class HttpsClient { private static final Logger LOGGER = LoggerFactory.getLogger(HttpsClient.class); @@ -142,34 +146,10 @@ public class HttpsClient { } private static SSLContext getTrustAllSSLContext() throws Exception { -// SSLContext context = SSLContexts.custom().loadTrustMaterial(null, new TrustStrategy() { -// -// @Override -// public boolean isTrusted(X509Certificate[] arg0, String arg1) -// throws java.security.cert.CertificateException { -// // 这一句就是信任任何的证书,当然你也可以去验证服务器的真实性 -// return true; -// } -// }).build(); SSLContext context = SSLContext.getDefault(); return context; } -// public static void main(String[] args) throws IOException { -// File file =new File("/Users/qi_liang/Downloads/timg.jpeg"); -// String url = "https://api.weixin.qq.com/cgi-bin/media/upload"; -// Map params = new HashMap(); -// params.put("access_token", "10_0oKKCsF9JL30JeGZDyfNWDhiaRvivAL9vs9ihvaledzBuPVM6IMvwcFUc58AFwlETRdvEBAFXOYbF2GoKmbtMmopCs78m9UE8whgrYU4kJww4mSooMcq8el-qnU4JdjPGKruZLjdNS246hXyWOHbAAAHZS"); -// params.put("type", "image"); -// if(file.exists()){ -// params.put("media", file); -// } -// String resultStr = post(url,params); -// System.out.println(resultStr); -// } - public static void main(String[] args) { - - } }