How to make non https urls work in newWebView?

Hello everyone,

My app was working fine with non HTTPS urls. A couple of days before my client told me to make some changes in the app so I updated solar2d to the latest build 2022.3672.

It’s a web app, so I am using newWebView to load urls. The web addresses with http protocol doesn’t work anymore. It shows an error code -1.

Is there any solution to make http urls work? Or I have to purchase SSL certificate for my clients domain to make it work?

Thank you,

I believe you have to purchase SSL, websites are increasingly requiring HTTPS instead of unsecured HTTP. Unless you’re accessing a local html on the device, I think you’ll have to switch to HTTPS for external requests.

1 Like

Thank you for the response. I’ll switch to HTTPS…

1 Like

In your project folder go to this path

AndroidResources\res

There should be a folder named xml, if not then create it and inside this folder put the attached xml file

and edit the xml file to include your URLs instead of the four ones that i left you as an example … you can add as many as you like … just the base url …

network_security_config.zip (327 Bytes)