RootEncoder icon indicating copy to clipboard operation
RootEncoder copied to clipboard

Protocol TLSv1.1 is not supported

Open RedwanSharafatKabir opened this issue 5 months ago • 7 comments

I am using your library to stream live on facebook. But getting following error. A few weeks ago it worked perfectly, reently I am getting this error.

Error: "Error configure stream, protocol TLSv1.1 is not supported"

When I start streaming through RTPService, it immadiately call the function onConnectionFailed:

override fun onConnectionFailed(reason: String) { if (camera2Base?.streamClient!!.reTry(5000, reason, null)) { showNotification("Connection end, will terminate or reconnect") } else { camera2Base?.stopStream() } }

And the reason is: Error configure stream, protocol TLSv1.1 is not supported.

Can you please explain why is this occuring and how to solve it?

RedwanSharafatKabir avatar Sep 03 '25 15:09 RedwanSharafatKabir

Hello,

Did you updated the library? In that case, can you tell me the previous version used?

pedroSG94 avatar Sep 03 '25 17:09 pedroSG94

The library version I used is 2.4.6

RedwanSharafatKabir avatar Sep 03 '25 17:09 RedwanSharafatKabir

Is the problem after update to version 2.6.4? Did you tried use JAVA sockets?

genericStream.getStreamClient().setSocketType(SocketType.JAVA)

pedroSG94 avatar Sep 03 '25 18:09 pedroSG94

I am using this version for last few months. After implementing this version live streaming was going well. And I did not use any socket separately.

RedwanSharafatKabir avatar Sep 03 '25 18:09 RedwanSharafatKabir

Did you change java version of your project? I detected an error creating java socket that depend of your java version (affect to java 17+), using java 11 or less, the problem is fixed without change the code.

I did a fix for it here: https://github.com/pedroSG94/RootEncoder/commit/faf64a6b5c1b9fc40289a32577073b6ca41d2f98

pedroSG94 avatar Sep 03 '25 18:09 pedroSG94

My java version is 17. I have removed "TLSv1.1" from enableTLSOnSocket() function in TLSSocketFactory?

private fun enableTLSOnSocket(socket: Socket): Socket { if (socket is SSLSocket) { // socket.enabledProtocols = arrayOf("TLSv1.1", "TLSv1.2") socket.enabledProtocols = arrayOf("TLSv1.2") } return socket }

Now its working fine. Should I make any other changes?

RedwanSharafatKabir avatar Sep 04 '25 07:09 RedwanSharafatKabir

That is enough, you can even remove that line like I did in the commit and then java will use any protocol available for TLS without the crash

pedroSG94 avatar Sep 04 '25 20:09 pedroSG94