I have set up an https server with wildcard certificates bought from Godaddy. The ssl certificates are properly installed on my server as I can access the site from the browser. Also, I have checked whether my ssl certificates were properly installed through https://www.digicert.com/help/ it shows everything is fine. Now my APIs are also hosted on this server and I need to access them from my react-native android app. The APIs are working fine if I call them from Postman but only get a 'Network failed' error upon calling from my app. I use axios as my http client for making api requests in my app.
10
-
can you please show us in code how you are accessing them? thanks. and do u have any errors in the console? try hitting the API from a web browser.letsCode– letsCode2019-01-04 13:54:22 +00:00Commented Jan 4, 2019 at 13:54
-
looks like your device/emulator or API server issue, not fetch/axios.Paweł Mikołajczuk– Paweł Mikołajczuk2019-01-04 13:58:22 +00:00Commented Jan 4, 2019 at 13:58
-
@DroiDev The code worked fine when the apis were hosted on a http server. The issue started when I made my server https from http. I tried calling a GET api from the browser and it fetches the response properly.M.S. Nikhil– M.S. Nikhil2019-01-04 14:30:22 +00:00Commented Jan 4, 2019 at 14:30
-
do you have the INTERNET permission in your manifest?letsCode– letsCode2019-01-04 14:31:48 +00:00Commented Jan 4, 2019 at 14:31
-
@PawełMikołajczuk The API server is working fine as I can get the response from Postman. I have worked on the same device for development and there were no issues when the apis were hosted from a http server.M.S. Nikhil– M.S. Nikhil2019-01-04 14:32:23 +00:00Commented Jan 4, 2019 at 14:32
|
Show 5 more comments
1 Answer
Not sure if you have already solved the issue, but we faced a similar issue. When we dug deeper, we found that the Godaddy certificate doesn't support SNI. We found a possible solution here. But we reverted to the older (Lets Encrypt) certificate.