Reputation: 521
I am unable to post an HTTPs call in android release apk. I have an android app which makes a https call for login, the request does not even reach the server. However it works in the debug apk version(http). The server logs not showing any error or warnings since the request itself doesn't reach the server. The apk is signed with the actual SHA certificate that is used to host the domain.
loginHandler(value) {
this.loader.display(true);
if (isNaN(value.email)) {
value.email = value.email.toLowerCase();
}
else {
value.email = value.email;
}
var loginValue = {
'username': value.email,
'password': value.password
}
this.loginService.loginService(loginValue)
.subscribe(res => {
this.loader.display(false);
this.message = '';
if (res.response.status === 'Success') {
} else {
this.errorMessage = res.response.validation;
this.errorMessage == 'Email not verified. Please check your email.'
? this.showResendVerification = true
: this.showResendVerification = false;
}
if (res.response.validation == "Email or phone number not verified.")
{
this.OTPHandler(value);
this.router.navigate(['/otp-verification']);
}
});
}
Upvotes: 0
Views: 874
Reputation: 11721
In debug build of cordova android apps, SSL errors are ignored so you can access to any server event if there is no certificate or a bad certificate (for example a dev server).
It behaves diferrently for release build, https connections will fail if the server has :
To be sure, you should try to open the browser on the device and open the https url you use in your app. If you get a warning about security, you will know there's an issue with the server certificate.
You can also try to patch the cordova sources so the ssl errors are not ignored even in debug see this post. (then your ssl calls should fail even in debug)
Upvotes: 1