How to add TLS v 1.0 and TLS v.1.1 using retrofit

I use a modification for data transfer, but a few days ago I had a problem with ssl certificates:

SSL confirmation canceled ssl = error 0x7b93fcc0 during a system call. Connection reset by peer

as I understand it, I need to add the tlsv1 certificate inside the modification ...

any suggestions how to do this?

+1
source share
1 answer

If you use the OkHttp client for Retrofit, you must configure the cipher suites, as here, just change the version of TLS and suit your type of connection:

ConnectionSpec spec = new ConnectionSpec.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 about Square OkHttp wiki

+1
source

Source: https://habr.com/ru/post/1695049/


All Articles