14

I have been trying to implement TLS 1.2 on Android. I create an SSLSocket s but when I run s.getSupportedProtocols(), TLS 1.2 is not one of the options. TLSv1 and SSLv3 are supported but TLSv1.2 is not.

In relation to that question, the ciphersuite I need is also not on there (TLS_ECDHE_ECDSA_WITH_AES_256_...)

Any idea on what I could import or do to enable TLSv1.2 and that cipher on android? Is there something I am missing? Any ideas would be helpful! Thanks!

2
  • 1
    fwiw Android 4.1 Jelly Bean includes TLSv1.2 and TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
    – mfsiega
    Jul 3, 2012 at 19:21
  • @Otra are you able to fine any thing on that. I have same problem. and i can not upgrade my android OS. So your answer might help me.
    – Mr. Borad
    Jan 18, 2017 at 7:12

3 Answers 3

6

Just for documentation purpose (this question is 3.5 years old) - Android API documentation has a list of supported SSL/TLS per API level, including specific cipher suites: https://developer.android.com/reference/javax/net/ssl/SSLSocket.html

1

You can't really enable it if it is not there. To add support for TLSv1.2 you need to either add a new JSSE provider (not trivial), or if you only need a socket, probably implement it in native code using OpenSSL. Or simply use JB if you can.

4
  • I'm trying to implement TLS 1.2 for our apps supporting from android 2.3 and you mentioned here adding new JSSE provider . Would updating to latest JDK 1.7 help me in enabling TLS 1.2 since that would mean using latest JSSE provider? Jul 5, 2015 at 9:10
  • @VyshakhAmarnath Did you manage to enable TSL 1.2 on android 2.3?
    – aiden_fry
    Feb 24, 2016 at 15:58
  • @VyshakhAmarnath Did you get it to work on Android 2.3?
    – ifiok
    Apr 1, 2016 at 6:05
  • I didn't explicitly add JSSE provider. I used native SSL factory API and my code checks for list of supported TLS protocols . If TLS 1.2 is supported then use TLS 1.2 else use TLS 1.1 or TLS v1 Apr 1, 2016 at 8:29
1

If you are still stuck with 2.3 your best option would be to create (or use) an OpenSSL port for Android using NDK. OpenSSL has a configure options for Android. Using the NDK you can build either statically linked libraries or dynamically linked ones. Then use JNI and setup your TLS 1.2 session there. Even if you use JB you would have to first enable TLS 1.2. Your entire cipher suite is not listed so it is a possibility that it is still not available in JB, e.g, _GCM.

This table shows which cipher suites are supported by which API level.

This stackoverflow link also contains info on building openssl for use on Android.

1
  • Do you mind explaining more about this? Or do you know of a good example for this?
    – Jacksonkr
    Sep 14, 2015 at 15:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.