MCPcopy Create free account
hub / github.com/0linlin0/CyberBox / getTrust

Method getTrust

Skay_Exp/src/tools/HttpUtils.java:289–312  ·  view source on GitHub ↗

��ȡ����������

()

Source from the content-addressed store, hash-verified

287 * ��ȡ����������
288 */
289 private static void getTrust() {
290 try {
291 HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() {
292
293 public boolean verify(String hostname, SSLSession session) {
294 return true;
295 }
296 });
297 SSLContext context = SSLContext.getInstance("TLS");
298 context.init(null, new X509TrustManager[] { new X509TrustManager() {
299
300 public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {}
301
302 public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {}
303
304 public X509Certificate[] getAcceptedIssuers() {
305 return new X509Certificate[0];
306 }
307 } }, new SecureRandom());
308 HttpsURLConnection.setDefaultSSLSocketFactory(context.getSocketFactory());
309 } catch (Exception e) {
310 e.printStackTrace();
311 }
312 }
313
314}

Callers 2

getMethod · 0.95
doPostRequestMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected