Hi, Recently we upgrade our Mendix version from 8.6.0 to 8.6.3 and regenerated the android app using native template version 3.2.2 When starting the app, the following error message popups “A connection error occured” message, please try again later” And in the logs it shows the following logline: ReactNativeJS: 'Network request failed', 'construct@[native code]\firstname.lastname@example.org:28:482 Important to note is that the server uses a SSL certificate, which is singed by a custom CA, which is imported in the android device. In chrome the mendix homepage loads without any problems, However in the native app it does not seem to accept the connection. Did anybody experience similar issues?
In the end I was able to find the solution myself, which I'll share below.
As mentioned in the post the Mendix server used a SSL certificate which is signed by an internal custom CA.
By default behavior custom/user-added CA's are disabled, unless explicitly allowed via the network security configuration of the APK. See, the documentation below for a more detailed explanation.
“By default, secure connections (using protocols like TLS and HTTPS) from all apps trust the pre-installed system CAs, and apps targeting Android 6.0 (API level 23) and lower also trust the user-added CA store by default.”
Now proceed with the native builder command as usual.
During this step the network_security_config.xml will be included in the apk.
When installing custom CA/self-signed certificates on the android device, these will be taken into account.