retnet

okhttpclient

Mar 5th, 2020
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. ConnectionSpec spec = new ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS)
  2. .tlsVersions(TlsVersion.TLS_1_2)
  3. .cipherSuites(
  4. CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
  5. CipherSuite.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
  6. CipherSuite.TLS_DHE_RSA_WITH_AES_128_GCM_SHA256)
  7. .build();
  8.  
  9. OkHttpClient client = new OkHttpClient.Builder()
  10. .readTimeout(7000, TimeUnit.MILLISECONDS)
  11. .writeTimeout(7000, TimeUnit.MILLISECONDS)
  12. // .connectionSpecs(Collections.singletonList(spec)) // tambahan
  13. .build();
Add Comment
Please, Sign In to add comment