Fetch in react native wont work with ssl on android

后端 未结 1 672
悲&欢浪女
悲&欢浪女 2021-02-08 14:10

When I\'m using the fetch function in my react native apps, things work as expected on iOS, but gives an error in android. The error is \'TypeError: Network request failed\'. Do

相关标签:
1条回答
  • 2021-02-08 14:47

    There is a few workarounds for this issue mentioned here: Trust Anchor not found for Android SSL Connection

    However, if you are the server owner. I would suggest to review your server ssl certificate. I think that was because of missing CA certificate in your pem file. What I have done for my site is I created fullchain.pem by concating content of file.crt and file.ca-bundle as that order.

    Then I configure nginx (my server behind nginx) with: ssl_certificate /etc/nginx/ssl/fullchain.pem;

    The original document: https://www.digicert.com/ssl-certificate-installation-nginx.htm

    Hope that helps

    0 讨论(0)
提交回复
热议问题