Skip to content Skip to sidebar Skip to footer

How To Add Tls V 1.0 And Tls V.1.1 With Retrofit

I am using retrofit for data transfer, but few days ago i got problem with ssl certificates: SSL handshake aborted ssl=0x7b93fcc0 error during system call. Connection reset by

Solution 1:

If you are using OkHttp client for Retrofit, you should set up cipher suites like here, just change the TLS version and suits accordingly to your connection type:

ConnectionSpecspec=newConnectionSpec.Builder(ConnectionSpec.MODERN_TLS)  
.tlsVersions(TlsVersion.TLS_1_2)
.cipherSuites(
      CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
      CipherSuite.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
      CipherSuite.TLS_DHE_RSA_WITH_AES_128_GCM_SHA256)
.build();

more details on Square's OkHttp wiki

Post a Comment for "How To Add Tls V 1.0 And Tls V.1.1 With Retrofit"