alexrainman / ModernHttpClient

ModernHttpClient
MIT License
126 stars 27 forks source link

okHTTP Unable to find acceptable protocols (pre-Lollipop Androids) #46

Closed Logan2014 closed 4 years ago

Logan2014 commented 4 years ago

I've got this issue on KitKat Android device. There's some resolution for this issue: https://stackoverflow.com/questions/32425547/okhttp-unable-to-find-acceptable-protocolsandroid

Maybe this can also help: https://medium.com/tech-quizlet/working-with-tls-1-2-on-android-4-4-and-lower-f4f5205629a

Some more info from console logs:

NativeMessageHandler.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken)
java.net.UnknownServiceException: Unable to find acceptable protocols. isFallback=false, modes=[ConnectionSpec(cipherSuites=[TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256, TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_GCM_SHA384, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA], tlsVersions=[TLS_1_2, TLS_1_3], supportsTlsExtensions=true)], supported protocols=[SSLv3, TLSv1]
okhttp3.internal.connection.ConnectionSpecSelector.configureSecureSocket ConnectionSpecSelector.java:73
alexrainman commented 4 years ago

@Logan2014 expect a fix in the next release.

alexrainman commented 4 years ago

Found a better way to do it: https://stackoverflow.com/questions/33112340/how-do-i-enable-tlsv1-1-on-xamarin-android-api-16-19