Android Question Error in CreateTrustAllSSLSocketFactory

MarcoRome

Expert
Licensed User
Longtime User
Hi All. I have this code in B4A ( in B4J work very well )

B4X:
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 '<---- Here ERROR
End Sub

When run i have this error:


Any idea ?
Thank you
Marco
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…