React Native Post Request via Fetch throws Network Request Failed

前端 未结 9 1573
[愿得一人]
[愿得一人] 2020-12-15 16:51

I´ve came across the following error. At the moment I developing an Android App with React Native therefore I´m planning to use fetch for doing a post request for me.

9条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-15 17:06

    I had this problem on Android due to an expired certificate. The error message I had was com.android.org.bouncycastle.jce.exception.ExtCertPathValidatorException: Could not validate certificate: Certificate expired at Fri Sep 29 16:33:39 EDT 2017 (compared to Fri Dec 08 14:10:58 EST 2017).

    I was able to confirm this using digicert.com.

    Unfortunately I did have to dig rather deep into the React Native code and debug the XHR code in the bundle (index.android.bundle) in order to find the error message and the URL in question, because it was in some of my logging code, which I obviously didn't log to the console as well. :)

    I was helped by this GitHub issue comment.

提交回复
热议问题