Use of HTTP requests blocked in Ionic v7?

Previously on ionic v5 I was able to send HTTP requests to a server running on the local network.

Now I get this error when the app runs on the device

Cleartext HTTP traffic to 192.168.1.254 not permitted

Is there anyway to allow making HTTP calls?

I also tried installing self-signed SSL cert on the local webserver and still got the following error

Line 1 - Msg: log testHttps error ====================> Error: java.security.cert.CertPathValidatorException: Trust anchor for
certification path not found.

No one should be using http calls due to security reasons. You need to be using https. you can try to use CapacitorHttp and see if it will allow http.

As @Hills90210 said, it is highly recommended to use HTTPS. BUT, if you really want to use HTTP, you can allow clear text for your specific IP/Domain on Android via the AndroidManifest.xml file.

See my comment over here - Unable to carryout HTTP post on Android - #2 by twestrick.

1 Like

oh nice! let me try that. It’s a local print server that uses http.

If this works, is there a workaround for IOS?

Anyway to get a Self-signed cert to work? I tried that on the http server and still got blocked by android.