Hi...
I'm using this code Below) for an SSL connection to servers.
In some cases I get handshake errors.
I think I can resolve this by adjusting the exact protocol (eg TLS versions) and ciphersuites in use.
Can someone please advise how to adjust those parameters?
Thanks!
I'm using this code Below) for an SSL connection to servers.
In some cases I get handshake errors.
I think I can resolve this by adjusting the exact protocol (eg TLS versions) and ciphersuites in use.
Can someone please advise how to adjust those parameters?
Thanks!
B4X:
Private Sub CreateTrustAllSSLSocket (EventName As String) As Socket
Dim socket As Socket
socket.Initialize(EventName)
Dim jo As JavaObject = socket
jo.SetField("socket", CreateTrustAllSSLSocketFactory.RunMethod("createSocket", Null))
Return socket
End Sub
Sub CreateTrustAllSSLSocketFactory As JavaObject
Dim tm As CustomTrustManager
tm.InitializeAcceptAll
Dim SSLContext As JavaObject
SSLContext = SSLContext.InitializeStatic("javax.net.ssl.SSLContext").RunMethod("getInstance", Array("TLS"))
SSLContext.RunMethod("init", Array(Null, tm, Null))
Dim Factory As JavaObject = SSLContext.RunMethod("getSocketFactory", Null)
Return Factory
End Sub