Making http call using SSL throws an error ( java.lang.AssertionError: No System TLS)

1,588 views
Skip to first unread message

eric....@solaraccounts.co.uk

unread,
Jun 1, 2018, 10:15:22 AM6/1/18
to j2objc-discuss

I am trying to convert some code which made calls to a webserver using SSL.  Is this something that j2objc should be able to convert?  I've tried a couple of HTTP libraries with similar results.

My current thinking is that maybe that these calls need to be recoded manually.  Or is there some workaround?  


on in thread "main" java.lang.AssertionError: No System TLS

at 0x000000010a73cb05 java.lang.AssertionError.<init>() + 45

at 0x000000010ad7d28e okhttp3.internal.Util.assertionError() + 78

at 0x000000010ad3db43 okhttp3.OkHttpClient.systemDefaultTrustManager() + 979

at 0x000000010ad3d2dc okhttp3.OkHttpClient.<init>() + 1452

at 0x000000010ad410b9 okhttp3.OkHttpClient$Builder.build() + 25

at 0x000000010ac9ab61 com.solaraccounts.network.welcome.WelcomeService.login() + 2065

at 0x000000010ac7b626 DoIt.main() + 70

at 0x000000010ac7b5cd DoIt.main() + 29

at 0x000000010ac5f6dd java.lang.reflect.Method.invoke:object:() + 22

at 0x000000010ac5f306 java.lang.reflect.Method.invoke() + 333

Caused by: java.security.NoSuchAlgorithmException: SunX509 TrustManagerFactory not available

at 0x000000010ab73e0b sun.security.jca.GetInstance.getInstance() + 175

at 0x000000010a9c04de javax.net.ssl.TrustManagerFactory.getInstance() + 37

Tom Ball

unread,
Jun 11, 2018, 4:29:23 PM6/11/18
to j2objc-...@googlegroups.com
No, j2objc doesn't support TLS at this time. To simply connect with HTTPS, use URLConnection with an https:// URL. Otherwise you'll need to define an interface that describes your app's networking requirements, and on iOS implement it in Objective C or Swift using the iOS security API.

--
You received this message because you are subscribed to the Google Groups "j2objc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to j2objc-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

mwendw...@gmail.com

unread,
Feb 14, 2019, 9:05:55 AM2/14/19
to j2objc-discuss
I ran into the same problem today. The reason for that is because the file JAVA_HOME/jre/lib/security/cacerts is corrupt or in some invalid format. On OpenJdk8, I found the file was in HTML instead of a java keystore. To fix that, I copied a keystore (JAVA_HOME/jre/lib/security/cacerts) from an existing and functional Oracle Jdk installaion. That can also be fixed by creating another keystore using Java's own keytool.
Reply all
Reply to author
Forward
0 new messages