React Native Android [AxiosError: 网络错误]

huangapple go评论51阅读模式
英文:

React Native Android [AxiosError: Network Error]

问题

我的React Native项目在Android和iOS上都成功运行。但突然间,在Android上的http请求失败了。在iOS上仍然正常工作。当我将域名更改为IP地址时,在Android上可以正常工作。为什么会发生这种情况?我尝试将请求头中添加Content-Type,如下图所示,但仍然得到相同的结果。

英文:

My React Native project was successfully running on both Android and iOS.
But suddenly it http request failed on Android.
It's still working find on iOS.
When I change the domain to ip address it works fine on Android.
Why does this happen?
enter image description here

I tried to add content-type to request headers like below but still get the same results.enter image description here

答案1

得分: 0

我解决了这个问题。
以下链接对我有帮助。
https://community.f5.com/t5/technical-forum/ssl-handshake-failed-for-tcp-android-application-request/td-p/312099

我没有正确安装链证书,所以在 Android 上握手失败。
https://www.sslshopper.com/ssl-checker.html

安装了链证书后,一切正常。

英文:

I figured out the problem.
Below link helped me.
https://community.f5.com/t5/technical-forum/ssl-handshake-failed-for-tcp-android-application-request/td-p/312099

I didn't install chain certificate correctly, so handshake was failed in android.
https://www.sslshopper.com/ssl-checker.html

Installed chain certificate and it worked well.

huangapple
  • 本文由 发表于 2023年6月16日 10:11:32
  • 转载请务必保留本文链接:https://go.coder-hub.com/76486557.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定