Can't connect to local server from ionic android

Hi, I’m trying to run ionic tutorial with OpenVidu server deployed on a local machine, but every time I’m trying to join a room, I’m getting this exception:

I/Capacitor/Console: File: http://localhost/vendor.js - Line 97827 - Msg: 'OpenVidu' initialized
I/Capacitor/Console: File: http://localhost/vendor.js - Line 97828 - Msg: openvidu-browser version: 2.11.0
D/Capacitor: Handling local request: http://localhost/23.js
D/Capacitor: Handling local request: http://localhost/svg/md-power.svg
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
I/X509Util: Failed to validate the certificate chain, error: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
E/chromium: [ERROR:ssl_client_socket_impl.cc(941)] handshake failed; returned -1, SSL error code 1, net_error -202

The same ionic app works great when running on the pc (server is running on the pc as well).

Btw, I’m using capacitor instead of cordova

I managed to fix this issue by using https://github.com/silkimen/cordova-plugin-advanced-http instead of @angular/common/http, but know I have a similar problem with wss:// connection.

Solved with https://stackoverflow.com/a/57811110/8728510