-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fetch is not working for https in android platform #12903
Comments
I'm facing the same problem. Is there a solution to this? |
Also I'm facing this problem |
same here |
I have the same issue on iOS. I can't allow self-signed certificates for some reason. |
@dave-irvine For iOS, just make an extension for This will not break the source code of React Native, also verify you certificates as you want. |
facing the same problem, need help! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions. |
Also I'm facing this problem |
Also I'm facing this problem. please help me to solve this issue |
Before [1] this was possible by customizing the okhttp client on android. It's no longer possible. |
It's a need this |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions. |
Still facing this issue in latest RN Version == |
Same issue here, Generating a debug APK or using react-native run-android I able to fetch the HTTPS URL, but unfortunately with release APK it always timeout (trying to get some logcat logs to help with this issue), I think it as something relates to SSL Exception by Android platform. react-native info:Environment:OS: Windows 10 Packages: (wanted => installed)react: 16.3.1 => 16.3.1 |
Hi, I have this problem only in one specify WI-FI connection, but in the same network with my computer I am able to access the HTPPS URl and having GET,POST, all working via browser/postman. I don't know what can be. |
Did you solve it? |
In my case, it was a backend problem with certificates that cause Android not getting any responses. |
I have same problem with android sdk < 21 Same request works as expected on iOS and Android sdk > 21. This should be considered as bug in this Here is what i can observe so far: But! Both domains will work in default browser. Why it is possible to open Environment
|
https://github.com/MadGeorge Are you able to solve this issue. I face the same problem as you. Does anyone have solution for this problem. Please help me, thank you! |
A work around that I use for this issue, is to use react-native-fetch-blob. RNFetchBlob.config({ But above code will also give this error: The 2nd work around as per link: is to edit: /node_module/react-native-fetch-blob/android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java |
@haily2706 no I’m not. I turned off Cloudflare option to force domain to https this is only solution I found. |
I am facing some problem. My |
After switching to 0.57 + the problem is gone |
I am facing the same issue. my https server working fine with postman using a self-signed certificate. But unable to get any response from the server when using the react-native android app. |
I added the following code to the onCreate method of MainActivity and everything worked as it should.
UPDATE |
Dobrynia, Thanks for the suggestion, while I am trying this code, I am getting compilation errors, do I have to install any package for google libraries in react native, please suggest
FAILURE: Build failed with an exception.
BUILD FAILED in 3s C:\Users\Hemu\Downloads\Prototype-master\Prototype-master\newClient> |
same error, I use Cloudflare, my version of RN is 0.57.7 😢 @dobrynia don't compile , any fix? |
@HEMANT8712 and @lahed, is there the |
@dobrynia don't work for me. My solution: I configure Cloudflare to use http and https on my api, and everything else in https. When android version is < 20 I used http else https |
Hello there 👋 this issue has been reported for an old version of React Native. Ideally we'd like everyone to be using 0.59 (see the awesome changes it brought) but we know updating can be a pain. During 0.59 update, some changes were made to the android JSC, so it might have fixed this. But please, if it's actually still an issue with 0.59 please comment below and we can reopen it. Even better, please send us a pull request with a fix 😊 |
Still an issue on react 0.59 for me. My configuration is almost same as @MadGeorge Switching to http helps |
I'm facing the same issue |
I am facing same issue |
1 similar comment
I am facing same issue |
try this |
same issue RN version 0.61.4 |
2020 and the same problem with axios :( |
I solved my problem with axios by passing data anyway.
|
Description
I've create a self-signed http & self-sign certificate https server in one app by using express.js
Fetch is working fine when I send the request to http port.
But it is fail when I send the same request to https port.
I understand it might be due to self-sign certificate, but is there any way to ignore error due to self-sign certificate in android ?
Reproduction
fetch('https://192.168.1.21/Register/', { //not working
fetch('http://192.168.1.21:3000/Register/', { //working fine
//the rest of the code is the same.
Solution
Additional Information
The text was updated successfully, but these errors were encountered: