Skip to content

[Android] TLSv1.1 and TLSv1.2 not enabled on Android <5 by default (although supported) #1934

@rfc2822

Description

@rfc2822

Since Android 4.2, Android's TLS implementation supports TLS v1.1 and TLS v1.2, but it's not enabled by default. So, it's not enabled in okhttp, too (because it just takes the SSLSocketFactory from SSLContext.getInstance('TLS')).

I have played around with ConnectionSpec, but as I have understood it, ConnectionSpec is to set the allowed TLS versions, ciphers etc. and not to manipulate the enabled protocols of SSL sockets – please correct me if I'm wrong.

For Android 5.0+, TLSv1.1/1.2 is used when possible as expected.

Maybe you'll consider enabling TLS v1.1 and TLS v1.2 for Android >= 4.2 < 5.0 too. You can find some details in my blog article: http://blog.dev001.net/post/67082904181/android-using-sni-and-tlsv12-with-apache. My current workaround is to use a compatibility socket factory.

If you know an easier solution to get TLSv1.1/1.2 on Android <5 with okhttp, please let me know.

See also http://stackoverflow.com/a/29252730

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions