Ignore SSL certificates error in axios/fetch call in react-native expo android

筅森魡賤 提交于 2021-02-10 20:45:55

问题


I just started using react-native and am trying to build an android app with it.. I used create-react-native-app and used the expo template. But I'm not able to fetch data from my server kepp getting "Network Error". My server doesn't have a valid certificate currently. Is there any way to ignore ssl certificate errors in my fetch calls?


回答1:


Yes, only use the http instead https, and set the following line in your manifest

<application
...
android:usesCleartextTraffic="true"
...>


来源:https://stackoverflow.com/questions/59835051/ignore-ssl-certificates-error-in-axios-fetch-call-in-react-native-expo-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!