0

I just want to understand the difference between SSLSocket and SSLEngine classes? I can see in android document TLSv1.2 available for SSLSocket from API Level 16+ but for SSLEngine TLSv1.2 available from API Level 20+ https://developer.android.com/reference/javax/net/ssl/SSLSocket.html https://developer.android.com/reference/javax/net/ssl/SSLEngine

I am trying to use have created a server using https://github.com/TooTallNate/Java-WebSocket which is using SSLEngine. My server works fine with android devices running on API level 20+ but giving UNSUPPORTED_PROTOCOL error a device running on API level 17 during the handshake.

Steffen Ullrich
  • 114,247
  • 10
  • 131
  • 172
Pawan Gupta
  • 315
  • 1
  • 3
  • 16
  • `SSLSocket` is blocking. The `SSLEngine` is there to support non-blocking SSL, which very few have implemented successfully. They are two separate implementations of TLS, so it isn't too surprising that they got out of sync. in the release cycle. – user207421 Jun 18 '20 at 08:12
  • @MarquisofLorne Okay, so do you have any idea how we can use SSLEngine for devices running API level 16+ with TLSv1.2? – Pawan Gupta Jun 18 '20 at 10:27
  • According to what you've posted, you can't without going to API Level 20+. – user207421 Jun 18 '20 at 13:26
  • Resolved this issue by using Conscrypt Security Provider. – Pawan Gupta Dec 29 '20 at 10:57

1 Answers1

0

Resolved this issue by using Conscrypt Security Provider.

Pawan Gupta
  • 315
  • 1
  • 3
  • 16