MCPcopy Create free account
hub / github.com/Devo919/Gewechat / okHttpClient

Method okHttpClient

src/main/java/util/OkhttpUtil.java:24–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

22 private final static String token = "";
23
24 public static OkHttpClient okHttpClient() {
25 TrustManager[] trustManagers = buildTrustManagers();
26 return new OkHttpClient.Builder()
27 .connectTimeout(60, TimeUnit.SECONDS)
28 .readTimeout(60, TimeUnit.SECONDS)
29 .writeTimeout(60, TimeUnit.SECONDS)
30 .sslSocketFactory(createSSLSocketFactory(trustManagers), (X509TrustManager) trustManagers[0])
31 .hostnameVerifier((hostName, sessino) -> true)
32 .retryOnConnectionFailure(false)//是否开启缓存
33 .build();
34 }
35
36 private static TrustManager[] buildTrustManagers() {
37 return new TrustManager[]{

Callers 1

postJSONMethod · 0.95

Calls 2

buildTrustManagersMethod · 0.95

Tested by

no test coverage detected