Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25845] Android: Non-production app builds with modules crash on startup if TLS 1.1 or higher is required for Internet access

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2018-10-31T00:07:42.000+0000
Affected Version/sn/a
Fix Version/sRelease 7.5.0
ComponentsAndroid
LabelsTLS, android, network
ReporterJoren Vos
AssigneeJoshua Quick
Created2018-02-20T10:18:43.000+0000
Updated2018-12-11T11:49:29.000+0000

Description

Attachments

FileDateSize
20180307_130548-720.mp42018-03-07T12:17:46.000+00005890185
example.zip2018-03-07T12:14:50.000+00009297610

Comments

  1. Mostafizur Rahman 2018-02-22

    Hello [~jvos], Thanks for sharing with us.Please provide a full sample test code that regenerates the issue. Better to provide a sample app as an attachment here. We will test the issue in our environment. Also, provide the SDK and CLI version you are testing on.
  2. Joren Vos 2018-02-27

    Hi @Mostafizur Rahman As explained in the issue, it's just a normal Titanium project containing a module. I've attached an example project. Alloy version: 1.10.4 Titanium SDK: 6.3.0.GA CLI version 5.0.14 Same issue occurs when building an app with Titanium SDK 7.0.2.GA but I do not have a module for this SDK version to use in public environments. You can reproduce the issue by having the phone connected to a Hotspot (connected to Wifi point, but no connection to the internet), run the app. The app will crash.
  3. Sharif AbuDarda 2018-02-27

    Hello, Is this for a particular device or for all devices? Thanks.
  4. Joren Vos 2018-02-27

    Hi, I tested on different Android versions (4, 5, 6 and 7) and different devices (Samsung Galaxy Note 2, Samsung Galaxy S5 mini, Motorola Moto E 4G...) It’s not Android nor device-specific.
  5. Sharif AbuDarda 2018-03-03

    Hello, I can't reproduce the issue with Android 8.0.1. My device is connected to a hotspot network. And my Mac is also connected to the same network. The app builds fine with SDK 7.0.2.GA. Is there anything I am missing? Thanks.
  6. Joren Vos 2018-03-03

    The hotspot we are using needs a login. Without being logged in, every network call will be refused. In the browser, it would redirect to the webpage, but every Appcelerator app will crash. Please check that the hotspot does not allow internet traffic.
  7. Mostafizur Rahman 2018-03-05

    Hello, Tested the issue and unable to reproduce this on our end using SDK 6.3.0.GA. The module *com.apaladini.brightness* does not support latest SDK. My device is connected to a hotspot network. And my Mac is also connected to the same network. The app builds fine with SDK 6.3.0.GA.
  8. Joren Vos 2018-03-06

    Note that this is a _*+production issue+*_, we're waiting for actions...
  9. Joren Vos 2018-03-06

    Please read my comments. It’s just an EXAMPLE module. This issue happens on all SDK’s with any module. A HOTSPOT network is not enought, the HOTSPOT network may NOT be connected to the INTERNET.
  10. Joren Vos 2018-03-07

    I've just provided a new example with 7.0.2.GA SDK, valid module for this and a demo video. As you can see, I'm not signed in the hotspot (no internet access), when I open the app, after some time (when Verifying modules), the app crashes. [WARN] TiVerify: (Timer-0) [5002,5002] Verifying module licenses... [INFO] I/System.out: Thread-4064(ApacheHTTPLog):Reading from variable values from setDefaultValuesToVariables [INFO] I/System.out: Thread-4064(ApacheHTTPLog):isSBSettingEnabled false [INFO] I/System.out: Thread-4064(ApacheHTTPLog):isShipBuild true [INFO] I/System.out: Thread-4064(ApacheHTTPLog):getDebugLevel 0x4f4c [INFO] I/System.out: Thread-4064(ApacheHTTPLog):Smart Bonding Setting is false [INFO] I/System.out: Thread-4064(ApacheHTTPLog):SmartBonding Setting is false, SHIP_BUILD is true, log to file is false, DBG is false, DEBUG_LEVEL (1-LOW, 2-MID, 3-HIGH) is 1 [INFO] I/System.out: Timer-0 calls detatch() [ERROR] TiApplication: (Timer-0) [148,5150] Sending event: exception on thread: Timer-0 msg:java.lang.IncompatibleClassChangeError: Class 'ti.modules.titanium.network.NonValidatingSSLSocketFactory' does not implement interface 'org.apache.http.conn.scheme.SocketFactory' in call to 'java.net.Socket org.apache.http.conn.scheme.SocketFactory.createSocket()' (declaration of 'org.apache.http.impl.conn.DefaultClientConnectionOperator' appears in /system/framework/org.apache.http.legacy.boot.jar); Titanium 7.0.2,2018/02/09 10:59,undefined [ERROR] TiApplication: java.lang.IncompatibleClassChangeError: Class 'ti.modules.titanium.network.NonValidatingSSLSocketFactory' does not implement interface 'org.apache.http.conn.scheme.SocketFactory' in call to 'java.net.Socket org.apache.http.conn.scheme.SocketFactory.createSocket()' (declaration of 'org.apache.http.impl.conn.DefaultClientConnectionOperator' appears in /system/framework/org.apache.http.legacy.boot.jar) [ERROR] TiApplication: at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:189) [ERROR] TiApplication: at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:172) [ERROR] TiApplication: at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:130) [ERROR] TiApplication: at org.apache.http.impl.client.DefaultRequestDirector.executeOriginal(DefaultRequestDirector.java:1334) [ERROR] TiApplication: at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:700) [ERROR] TiApplication: at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:560) [ERROR] TiApplication: at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:514) [ERROR] TiApplication: at org.appcelerator.titanium.TiVerify.run(Unknown Source) [ERROR] TiApplication: at java.util.TimerThread.mainLoop(Timer.java:555) [ERROR] TiApplication: at java.util.TimerThread.run(Timer.java:505)
  11. Joshua Quick 2018-03-08

    Hmm... I can't reproduce this issue. I've tried the following on real devices (not the emulator) and on Android 8.0 and 4.2.2: * Connect to a WiFi access point which requires login through a web page. (ie: Connected to the network, but access point not providing Internet access.) * Set up an Android device as a hotspot, but without Internet access and have another Android device connect to it. In both cases above, the app launched quickly. I did see the the following TiVerify error messages get logged, but those are to be expected...
        [WARN] :   TiVerify: (Timer-0) [2879,5002] Verifying module licenses...
        [WARN] :   TiVerify: (Timer-0) [102,5104] Error Verifying License
        
    [~jvos], in the example app you posted, what happens if you exclude the "brightness" module? Does this issue still happen? I ask because I'm mostly concerned about the following logged error message...
        [ERROR] TiApplication: java.lang.IncompatibleClassChangeError: Class 'ti.modules.titanium.network.NonValidatingSSLSocketFactory' does not implement interface 'org.apache.http.conn.scheme.SocketFactory' in call to 'java.net.Socket org.apache.http.conn.scheme.SocketFactory.createSocket()' (declaration of 'org.apache.http.impl.conn.DefaultClientConnectionOperator' appears in /system/framework/org.apache.http.legacy.boot.jar)
        
    The above should not be happening with module verification since it doesn't use the mentioned "NonValdiatingSSLSocketFactory" class. Only our JavaScript "HTTPClient" class uses it. Is the log output from your last comment coming from the attached "example.zip"? Because this looks like its coming from your own JavaScript code. Can you confirm this please? Thanks.
  12. Joren Vos 2018-03-08

    Hi, Without any module, it works fine, but when I include any module (it doesn’t matter which one), the app crashes. It’s not related to the brightness module, in the example case I’m not invoking any method from the module. It’s just a new appc project with a random module. The module does some calls with the brightness and has no network calls. As you can see in the attached movie, I build the example project on my device. After a few seconds, the app crashes. I get the attached error log. It’s not related to my Javascript code since I’m nor doing anything. In my opinion, it’s related with something in the “TiVerify” that causes the app to crash when no internet connection is available. That’s also what the error message tells me... I think our hotspot forwards all calls to a http endpoint instead of a https endpoint.
  13. Joren Vos 2018-03-08

  14. Joshua Quick 2018-03-08

    [TIMOB-20579] is caused by a TLS certificate challenge. Yeah, the log output matches yours, so, good find. [~jvos], do you know if the server or access point you're connecting to requires an installed certificate on the client? Has your laptop and Android device ever display a dialog regarding a certificate the first time you used the web browser app? *Side Note:* We do not do module verification for "production" builds. That is, we don't validate on your customers devices. So, if you need to get development off the ground now, I recommend that you do this for the moment. Unfortunately, you won't have debugger support when doing this though. You can do a "production" build in Appcelerator Studio by selecting "Package" and "Android App Store" from the top-left drop-down boxes.
  15. Joren Vos 2018-03-08

    No, I never got a dialog regarding a certificate, nor on Android; nor on iOS. Okay, it's a good point that there is no module verification for production builds. We also have another Wifi network then our "Guest" hotspot, which does not require login, but this issue needs to be fixed.
  16. Joshua Quick 2018-03-08

    Or perhaps your access point is set up to use TLS version 1.1 or higher? I think this might be the issue. You can identify it via the Chrome web browser on your desktop. Go to your access point's IP address in Chrome (I assume it has a log in page), right click on the page in Chrome, select "Inspect" from the popup menu, click on the Security tab. It should tell you what the TLS version is there.
  17. Joren Vos 2018-03-12

    Hi Joshua, Our AP's use TLS 1.2.
  18. Joren Vos 2018-03-27

    Any update on this?
  19. Joshua Quick 2018-04-05

    [~jvos], The only work-arounds are:

    Test with a production/release build.

    Access the Internet via an access point that is NOT TLS 1.1 or higher.

    An alternative to #2 above is to set up a proxy to communicate to your TLS 1.2 access point and have your mobile device communicate via that proxy. It would then be the proxy's job to do the TLS handshaking.
  20. Joren Vos 2018-04-05

    Yes, I know there are workarounds to avoid the issue, but this needs to be fixed.
  21. Joshua Quick 2018-04-05

    Sorry, but there is no ETA for the moment.
  22. ardy wongso 2018-12-11

    i experience this issue in 7.5.0 by adding simple module
        [WARN] :   TiVerify: (Timer-0) [5002,5002] Verifying module licenses...
        [ERROR] :  TiApplication: (Timer-0) [881,5883] Sending event: exception on thread: Timer-0 msg:java.lang.IncompatibleClassChangeError: Class 'ti.modules.titanium.network.NonValidatingSSLSocketFactory' does not implement interface 'org.apache.http.conn.scheme.SocketFactory' in call to 'java.net.Socket org.apache.http.conn.scheme.SocketFactory.createSocket()' (declaration of 'org.apache.http.impl.conn.DefaultClientConnectionOperator' appears in /system/framework/org.apache.http.legacy.boot.jar); Titanium 7.1.0,2018/03/14 13:40,undefined
        [ERROR] :  TiApplication: java.lang.IncompatibleClassChangeError: Class 'ti.modules.titanium.network.NonValidatingSSLSocketFactory' does not implement interface 'org.apache.http.conn.scheme.SocketFactory' in call to 'java.net.Socket org.apache.http.conn.scheme.SocketFactory.createSocket()' (declaration of 'org.apache.http.impl.conn.DefaultClientConnectionOperator' appears in /system/framework/org.apache.http.legacy.boot.jar)
        [ERROR] :  TiApplication: 	at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:145)
        [ERROR] :  TiApplication: 	at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:169)
        [ERROR] :  TiApplication: 	at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:124)
        [ERROR] :  TiApplication: 	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:366)
        [ERROR] :  TiApplication: 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:560)
        [ERROR] :  TiApplication: 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:514)
        [ERROR] :  TiApplication: 	at org.appcelerator.titanium.TiVerify.run(Unknown Source:280)
        [ERROR] :  TiApplication: 	at java.util.TimerThread.mainLoop(Timer.java:555)
        [ERROR] :  TiApplication: 	at java.util.TimerThread.run(Timer.java:505)
        
  23. ardy wongso 2018-12-11

    sorry i compile in wrong sdk version. let me try in 7.5.0
  24. Muhammad Qasim 2018-12-11

    I am also getting this error all of a sudden today. It was working fine yesterday. I left office with project building successfully, came today and its throwing this error with app crash. Seems like something is changed on Appcelerator's servers :(
  25. ajit jati 2018-12-11

    Same issue with our app as well today. On production all of a sudden apps crashing.

JSON Source