flutter_downloader icon indicating copy to clipboard operation
flutter_downloader copied to clipboard

download http source err with cast to https failure in Android

Open WoodJim opened this issue 2 years ago • 2 comments

ERROR MSG : W/System.err: java.lang.ClassCastException: com.android.okhttp.internal.huc.HttpURLConnectionImpl cannot be cast to javax.net.ssl.HttpsURLConnection W/System.err: at vn.hunghd.flutterdownloader.DownloadWorker.downloadFile(DownloadWorker.java:317) W/System.err: at vn.hunghd.flutterdownloader.DownloadWorker.doWork(DownloadWorker.java:235)


see the source code fo DownloadWorker,found that " ignoreSsl = getInputData().getBoolean(ARG_IGNORESSL, false);" ignoreSsl is always false

WoodJim avatar Jun 09 '22 02:06 WoodJim

Just faced this bug myself, any fix @WoodJim?

FlutterDownloader.initialize(debug: true, ignoreSsl: true);

seems to fix the issue but it is not recommended for production application.

SrijanNeoSoftware avatar Jun 10 '22 12:06 SrijanNeoSoftware

see the source code fo DownloadWorker,found that " ignoreSsl = getInputData().getBoolean(ARG_IGNORESSL, false);" ignoreSsl is always false

It falls back to false. It is not always false. I'm currently very busy but will try to take a look at it in a few weeks.

bartekpacia avatar Jun 20 '22 18:06 bartekpacia

I still have this issue too. Any updates? I'm using flutter_downloader: ^1.7.4 on flutter 2.10.5.

rivetingpeppermint avatar Nov 14 '22 09:11 rivetingpeppermint

Is there a solution for this?

sirkalmi avatar Jan 20 '23 12:01 sirkalmi

Seems like a fix should be fairly simple, if anyone's willing to do it I'll be happy to merge and release a new version.

bartekpacia avatar Jan 20 '23 12:01 bartekpacia