Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] fetch return Network Request failed with Letsencrypt HTTPS websites #33111

Closed
Scarle-t opened this issue Feb 15, 2022 · 7 comments
Closed
Labels
Needs: Triage 🔍 🌐Networking Related to a networking API. Platform: Android Android applications. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@Scarle-t
Copy link

Description

Since the issue has been closed and I've already tried numerous "solutions" from that issue/ SO/ Internet but still no hope.
When doing a fetch request to a site using Letsencrypt certificate, it throws "Network Request failed" error on Android, works fine on iOS (both platforms' physical and emulator device behave the same)

The following code will return Network Request failed

fetch([redacted url using letsencrypt certificate], {
method: 'POST',
headers: {
    'Accept': 'application/json',
    'Content-Type': 'application/json'
},
body: JSON.stringify(someData)
}).then(res => res.json()).then(res => someFn()).catch(e => console.error(e))

I tried the same fetch with https://google.com it worked

Version

0.64.0

Output of npx react-native info

info Fetching system and libraries information...
System:
OS: macOS 12.1
CPU: (8) arm64 Apple M1
Memory: 82.48 MB / 16.00 GB
Shell: 3.3.1 - /opt/homebrew/bin/fish
Binaries:
Node: 17.5.0 - /opt/homebrew/bin/node
Yarn: Not Found
npm: 8.4.1 - /opt/homebrew/bin/npm
Watchman: 2022.02.07.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.2 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3
Android SDK:
API Levels: 29, 30
Build Tools: 28.0.3, 29.0.2, 30.0.2, 30.0.3, 31.0.0
System Images: android-25 | Google APIs ARM EABI v7a, android-31 | ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2020.3 AI-203.7717.56.2031.7784292
Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_302 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.1 => 17.0.1
react-native: 0.64.0 => 0.64.0
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

create project
make a fetch request to a https site

Snack, code example, screenshot, or link to a repository

fetch([redacted url using letsencrypt certificate], {
method: 'POST',
headers: {
    'Accept': 'application/json',
    'Content-Type': 'application/json'
},
body: JSON.stringify(someData)
}).then(res => res.json()).then(res => someFn()).catch(e => console.error(e))
@react-native-bot react-native-bot added Platform: Android Android applications. 🌐Networking Related to a networking API. labels Feb 15, 2022
@vaibhawc
Copy link

I too am facing same issue with urls that would work on browser but not on the app on same android phone.

@hoaxvo16
Copy link

You can try my solution

#24627 (comment)

@Aiosa
Copy link

Aiosa commented Aug 13, 2022

I am facing the same problem with Let's encrypt. Moreover, I noticed that this occurs (at least for me) only for certificates using 2048 bit RSA, 4096 bit works well, and it happens only on older android devices (don't know the boundary but the guess is version 7 and below). Since the bit length should not really matter, the problem should be somewhere in Let's encrypt cross-signing authority - probably a correlation with the bit length. Nothing helps really. Tried several independent websites, same behavior. Naturally both fetch and WebView are affected.

@Aiosa
Copy link

Aiosa commented Aug 13, 2022

After some digging, all domains I've tried are missing the last part in the chain every time they failed to load (openssl s_client -connect domain:443 -prexit):

 0 s:CN = domain
   i:C = US, O = Let's Encrypt, CN = R3
 1 s:C = US, O = Let's Encrypt, CN = R3
   i:C = US, O = Internet Security Research Group, CN = ISRG Root X1
 2 s:C = US, O = Internet Security Research Group, CN = ISRG Root X1
   i:O = Digital Signature Trust Co., CN = DST Root CA X3                                   <--- this one

Copy link

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Mar 21, 2024
Copy link

This issue was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Triage 🔍 🌐Networking Related to a networking API. Platform: Android Android applications. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

6 participants