Simulator cannot connect to backend in HTTPS: Unknown Error

Here are my observations

  • app (@ionic/angular 5.0.7; cf. ionic info below) works fine in chrome http or https
  • backend API called using postman works fine over http or https
  • app in iOS simulator using ionic cordova prepare ios then executing in XCode works fine in http but not in https; it does not reach the backend at all.

XCode Simulator error message is 2020-04-03 20:24:07.719639+0800 MyApp[23261:938958] ERROR: {"headers":{"normalizedNames":{},"lazyUpdate":null,"headers":{}},"status":0,"statusText":"Unknown Error","url":"https://localhost:443/api/v1/appname/signin","ok":false,"name":"HttpErrorResponse","message":"Http failure response for https://localhost:443/api/v1/appname/signin: 0 Unknown Error","error":{"isTrusted":true}}
any idea of what can be wrong in https from the simulator?

adding the certificate sounds recognised by the simulator (General > About > Certificate Trust Settings)

However the WebInspector shares this message
[Error] The certificate for this server is invalid. You might be connecting to a server that is pretending to be “localhost” which could put your confidential information at risk.

CORS is configured on the backend and sounds OK from the browser, but from the simulator over https the backend is even not reached