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
fileTransfer.download from https return error code 3 (SSL handshake) in android #203
Comments
@stackmanoj did you resolve this issue? even i am facing it |
i had faced the problem at last time, at that time ,i used the version is v1.5.1. Now i switch the lastest version ,v 1.7.1, but i can't solve the problem . So i change the android source code like this:
All the above changed are from the class ''FileTransfer.java" That can fix the bug to solve the problem that can't run on Android P ! |
@senjoeson , i tested in samsung device marshmellow, still getting SSL issue |
@pallaviMN thanks for your reply.Now can you tell me how to cause the error ? "upload" or "download"? |
download is causing the error, can you please upload your file. It will be useful @senjoeson |
Actually, its not entering that override method itself @senjoeson |
FileTransfer.txt |
@senjoeson , will add & let you know. Thanks a lot |
@senjoeson , i am using cordova 7.0.0, will it cause this issue? Because even your code didnt work for me |
@senjoeson , its not calling "private static HostnameVerifier hostnameVerifier = new HostnameVerifier " |
my means is add to .... sorry.it's my mistakes. |
sorry i didnt understand @senjoeson |
@pallaviMN ,i have corrent my word. Please revisit the instructions I wrote above. Thx. |
@pallaviMN If you have not solved the problem, please provide your contact information, I will talk to you privately. |
I am having problems when downloading files by https since I get error 3 and I have seen in the documentation that you can use the following option "trustAllHosts" but it is not valid for production ... someone could tell me how I could solve it for the production version? Since I have not found anything about it. |
I tried this but it is not working. I need to download a file from a server with self-signed cert but the app needs to by pass the SSL Cert check. Is there another way? |
I already fixed my issue. I followed the way the amazon source (FileTransfer.java) implemented the DO_NOT_VERIFY host name verifier and create anew sslsocket factory. |
Hello everybody. |
Hello everybody. |
You mention that you have fixed this issue by following Amazon, can you elaborate on what you did to fix this? |
Sorry @uldcra for the late reply. I am pretty busy the past few days... In the FileTransfer.java under Android Source, include this function:
and then in the function, insert this between line 760 and 761
This will skip the HTTPS SSL Cert verification. I attached my code. (just change it back to .java) Again sorry for the delay... |
Hello wynngd. |
We use file-transfer with Ionic and Capacitor:
Unfortunately, the method download() on Android devices always results in the exception FileTransferError.CONNECTION_ERR:
We also tried to apply the patch of @wynngd without any success. On iOS devices, the plugin works like a charm. Is there any chance, that this issue gets fixed? |
No, this plugin is deprecated The issue is older android devices don't have TLS enabled by default, but most devices do support it. I have a fork that solves this problem, but you also need to use a custom If you want to fix this in your own forks, you can look at the following commits: cordova-android: totalpave/cordova-android@b6e5504 These changesets will make the older android devices (tested as far back as android 4.1) use TLS 1.1 & TLS 1.2. If you want to change this, see totalpave/cordova-android@b6e5504#diff-1a0a158bbbc267048975894bb6ce2217R66 The commits are consolidated enough that you should be able to fork the repos, and add my fork as a remote, to If the requested TLS is not available on the device, I'm assuming the app will crash, but I've never seen that in our crash analytics. Note: I would refrain from using the totalpave fork's, I'm no longer maintaining them as we have moved on. So both the |
Hi @breautek, thanks for your fast reply. Referring to the depricated message: does it mean that the further development of this plugin has been discontinued? Thanks, Timo |
Yes. The deprecation message provides links that explains how to migrate away from this plugin. |
Thanks @breautek ! |
anyone else have any other solution for this issue? tried @wynngd solution but with no success on Android |
Using wynngd's solution, which bypasses SSL validation is never a good idea. First, I'd recommend moving away from this plugin altogether, because this is plugin is deprecated. Read this to learn how If for some reason you cannot, then #203 (comment) may help you. |
Closing this issue, as we won't support Android <5.1 (API level <22) in future releases of plugins and cordova-android already dropped support for it. |
I am downloading file using this
fileTransfer.download(sourecUrl, destinationPath,successCallback,errorCallback,true,{});
In error callback I am receiving error code 3 (SSL handshake)
TLS1.2 is used in my server.
Android version is 4.4.3
The text was updated successfully, but these errors were encountered: