When deployed on Android device https calls don't work

I have an existent and working Ionic4 app that uses web services for authentication and to get data from a remote server.

I was using HTTP, but now I’d like to use HTPPS.
I have changed the code by replacing Http with Https.

This is the code for the login phase, for example:

import {HttpClient, HttpHeaders} from '@angular/common/http';
    const loginUrl = 'https://myserver.com:3843/auth/login';
    return  this.httpClient.post(loginUrl, {
      email: username,
      password: password

When I use the app locally from the browser it works (ionic serve -lcs).
If I use the app with the device in debug (ionic cordova run android), it works.

But if I produce the apk and I test the app on the mobile device, it doesn’t work.
On the server, the request doesn’t arrive.

What could be the problem?
How can I debug the problem? since running the app in debug it works.

Thank you very much.


Is there a way to debug this problem?

I am not sure if this is the same thing, but I have one device with Android 6 where HTTP post and HTTP get don’t work. There are other devices with older Android and other devices with newer Android where it works. Also note that it’s not like the device has broken connection - other apps from store work just fine. But unfortunately I can’t help you. I wasn’t able to solve it so far…

I’m using the port 4433 and not the port 443.

Could this be the problem?
Is it possible to use a port other that 443 for https?
And the Let’s Encrypt certificate is valid only for the port 443 or is it possible to use it also for other ports?


I’ve solved this problem.
In this thread the solution: