I created an app via cordova/PhoneGap is loaded and running successfully on PlayStore.
This app performs call in Ajax in https (with certificate).
A short time ago I renewed this certificate for my domain and from that moment the app stopped working.
I read this: https://developer.android.com/training/articles/security-ssl.html#Blacklisting
That Android can block my calls? I ended up in the blacklist? How do I check this?
NOTE: The same app for the iPhone has remained functional. For this reason I think it is the only cause.
The SSL Labs Server Test indicates that the server is sending an incomplete certificate chain for this domain. You can use What's My Chain Cert? to obtain the correct chain that needs to be sent by your server and Android apps should be able to validate trust.
As for why this worked in iOS and not in Android, check out this answer.
Related
Could you suggest how to add a self-signed certificate on Android (MIUI 12, Android 10).
There is a mobile app for Android, and a backend written in symfony. We have a bug that is very difficult to catch, and it is not clear whether it is a bug in the app or a problem in the backend. Currently, it is not known which endpoints in which order the mobile app calls. When I test my local backend through postman, everything works as expected (there is no bug). When I test on Android (which is directed to the stage), I can see a bug. Hence, it was decided to build the application directed to local backend by replacing the api-url with the hostname of my laptop. Then the requests would go over the local network to the local backend, where it would be possible to debug what exactly is happening. But once we've built the app, it turned out that it's not that simple to send requests to the local backend since a self-signed certificate is used. I tried to add this certificate to the android config, but nothing changed. Though, certificate shows up in the list. Maybe I made some mistakes when converting that certificate (because xiaomi doesn't allow to import a .crt file), or maybe it's backend that is configured incorrectly.
Can anyone who has encountered such a problem tell me how to set the environment up correctly. Maybe there is some guide on this topic.
PS. It is not an option to use Ngrok, because it will be necessary to distract the mobile team every time in order to build the application with the new url.
I'm working on a native app for iOS and Android using React-Native. I have to hit a third-party REST API that uses https:// protocol. There is a staging server and a production server for the API.
I have success making requests to both servers on iOS. On Android, I can access staging, but not production. Requests to both servers are successful using Postman.
Requests to production on Android give me the infamous [TypeError: Network request failed] message. I looked around on this site and elsewhere, and learned that this is usually the result of a certificate trust issue (which is not something I'm super knowledgeable about). I used openssl to view the certificates and did see three certs when checking staging, and only two for production. I tried following the custom TrustManager example on the Android HTTPS and SSL page: https://developer.android.com/training/articles/security-ssl.html
As well as this tutorial for SSL pinning: https://medium.com/the-many/a-year-of-react-native-ssl-pinning-3801a973cbfe
No luck. I should probably mention that at no point have I seen any logcat messages referring to certificate trust errors, so I'm not even entirely sure this is my issue.. it's just the only thing that makes sense based on what I've been able to find out. I tried going to Android Studio Preferences > Tools > Server Certificates and enabled 'Accept non-trusted certificates automatically' as a sanity check for testing. Still no luck and no change in log messages.
The requests are formatted exactly the same in React-Native, and are successful in three out of four of my scenarios (iOS staging & prod, Android staging). What am I missing?
I am having a very strange issue with my Cordova app. In iOS (both on development and in production) all AJAX calls work fine. When installing the Android app by just downloading the APK file and installing that way, all AJAX requests work fine.
But when using my app from the Google Play Store distribution, all AJAX "POST" requests are being sent as "GET" requests, which as you can imagine is breaking functionality.
I have a hot fix on the backend right now which accepts only the important 'POST's as 'GET's, but this is obviously not ideal.
Has anyone ever ran into this problem before or have any ideas on how to fix this?
UPDATE: Now the "GET" method works, but none of my AJAX parameters are being sent to the backend from the request (again, only when installing from Google Play Store).
Problem was that I was not using a properly certified SSL certificate over an https connection!
I have a backend server that is accessible on two ports - one with HTTP and another with HTTPS. It uses a self-signed certificate.
From my ionic/cordova hybrid app when I run using HTTP requests they all succeed. During first request I also include a basic authorization. However, the exact same requests fail when using HTTPS. For example
http://10.1.2.3:8000/hello.js <<< works like a charm
https://10.1.2.3:8100/hello.js <<<< this fails (but works in android browser after a warning page)
I wonder how to proceed. Do I need to register the self-signed certificate somewhere in config, or something else?
Thanks a lot.
I wonder if you have found your answer or not, but still want to post answer for others looking for the solution: Cordova doesn't allow https calls to Servers with untrusted ssl certificate installed on them. You can ignore this error and continue by making a small change in a cordova file.
Open “\cordova\platforms\android\CordovaLib\src\org\apache\cordova\ CordovaWebViewClient.java”. In 'onReceivedSslError' method, comment the else part and add handler.proceed() instead.
I am developing phoneGap application which is integrated with web service for requesting data.
Communication used to happen through HTTP but I want to take it to HTTPS communication.
I integrated SSL for my tomcat server and I can send HTTPS request from RESTClient using browser.
But my phoneGap mobile application is not able to communicate for HTTPS request.
Any extra setting required for it?
I am targeting android and iOS for now.
Any help will be appreciated.
We had to face the same issue last week in our own project.
In Android we didn't have any problem with it, we observed that Android trusted all the certificates (are you having issues with Android?), however in iOS we had some trouble.
The first thing you can do is to install the trusted certificate in your iOS... but it will be problematic for basic users.
The solution we decided to take was to allow access to all SSL for our application, in order to do that you have to add the next code at the end of your AppDelegate.m file:
#implementation NSURLRequest(DataController)
+ (BOOL)allowsAnyHTTPSCertificateForHost:(NSString *)host
{
return YES;
}
#end