1

The back end is in PHP, deployed on a Docker Container, running localy.
The nginx image is listening on port 443.
It does have SSL ceritificates.
I'm using an Android Simulator with Android 11.0.
I tried and successfully accessed an app via HTTP, without certificates. It worked in browser, with the Android Simulator's manual proxy configuration.
Host name: appname.com | Port: 8080
Now I have to access the PHP app mentioned above, in browser. I did the same settings for proxy:
Host name: beta.yyyyyy.com | Port: 443 - proxy status successful
proxy success screenshot
And I get this reponse:
simulator browser response

I get the same error ( Connection refused ) when I make requests from an app within the simulator.

I tried putting PC's IP and 10.0.2.2 instead of host name, specifying the port at the end of the base url.
I can connect to the app via PC's browser.
Only the Simulator does not know how to encrypt / make the HTTPS requests.
How to make the Simulator send HTTPS requests?

Edit: On a Windows PC

danyelss
  • 21
  • 4
  • If you are using https you need a certificate that matches the hostname or IP. So you have to use an certificate that has the subject alternative name 10.0.0.2 and that is trusted on the device respectively the app you use. If you are not using a browser app like chrome then the certificate has to be embedded into the app itself and trusted using https://developer.android.com/training/articles/security-config – Robert Jan 28 '22 at 14:40

0 Answers0