0

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.

M.S. Nikhil
  • 181
  • 11
  • 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 Jan 04 '19 at 13:54
  • looks like your device/emulator or API server issue, not fetch/axios. – Paweł Mikołajczuk Jan 04 '19 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 Jan 04 '19 at 14:30
  • do you have the INTERNET permission in your manifest? – letsCode Jan 04 '19 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 Jan 04 '19 at 14:32
  • @DroiDev I have the INTERNET permission in my manifest file. – M.S. Nikhil Jan 04 '19 at 14:33
  • is this any help for you? https://github.com/axios/axios/issues/662 – letsCode Jan 04 '19 at 14:37
  • @soldforapp Thanks for the link but the solutions there use nodejs core https module, which is not supported in react-native. Also, I tried calling other openly available https apis and they work properly with axios and fetch. I guess I need to configure something to make my https apis work in android. Please let me know if I am missing something. – M.S. Nikhil Jan 07 '19 at 05:48
  • Contact Google support and ask if you need something else. Maybe that https is on a proxy, so u might need something else. I use php to hit my https and that works fine. – letsCode Jan 07 '19 at 11:18
  • i apoligize, i meant godaddy support. – letsCode Jan 07 '19 at 17:32

1 Answers1

0

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.

Pooja
  • 107
  • 1
  • 8