问题
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 peer
as I understand I need to add tlsv1 certificate inside retrofit...
any suggestions how to do it?
回答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:
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 details on Square's OkHttp wiki
来源:https://stackoverflow.com/questions/33693120/how-to-add-tls-v-1-0-and-tls-v-1-1-with-retrofit