fluttercommunity / fluttercommunity/flutter_downloader

System.err: javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.

Open
#397 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
940
Forks
561
Avg merge
1h 18m
Merged PRs (30d)
1

Description

I have SSLHandshakeException when I try to download file. How to resolve it? Full log:

javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
2021-01-13 12:40:46.514 20619-21138/com.action.buhsoft W/System.err: at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:361)
2021-01-13 12:40:46.514 20619-21138/com.action.buhsoft W/System.err: at com.android.okhttp.Connection.connectTls(Connection.java:235)
2021-01-13 12:40:46.514 20619-21138/com.action.buhsoft W/System.err: at com.android.okhttp.Connection.connectSocket(Connection.java:199)
2021-01-13 12:40:46.514 20619-21138/com.action.buhsoft W/System.err: at com.android.okhttp.Connection.connect(Connection.java:172)
2021-01-13 12:40:46.514 20619-21138/com.action.buhsoft W/System.err: at com.android.okhttp.Connection.connectAndSetOwner(Connection.java:367)
2021-01-13 12:40:46.514 20619-21138/com.action.buhsoft W/System.err: at com.android.okhttp.OkHttpClient$1.connectAndSetOwner(OkHttpClient.java:130)
2021-01-13 12:40:46.514 20619-21138/com.action.buhsoft W/System.err: at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:329)
2021-01-13 12:40:46.514 20619-21138/com.action.buhsoft W/System.err: at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:246)
2021-01-13 12:40:46.514 20619-21138/com.action.buhsoft W/System.err: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:457)
2021-01-13 12:40:46.514 20619-21138/com.action.buhsoft W/System.err: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:405)
2021-01-13 12:40:46.514 20619-21138/com.action.buhsoft W/System.err: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:521)
2021-01-13 12:40:46.514 20619-21138/com.action.buhsoft W/System.err: at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105)
2021-01-13 12:40:46.514 20619-21138/com.action.buhsoft W/System.err: at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java)
2021-01-13 12:40:46.514 20619-21138/com.action.buhsoft W/System.err: at vn.hunghd.flutterdownloader.DownloadWorker.downloadFile(DownloadWorker.java:279)
2021-01-13 12:40:46.514 20619-21138/com.action.buhsoft W/System.err: at vn.hunghd.flutterdownloader.DownloadWorker.doWork(DownloadWorker.java:193)
2021-01-13 12:40:46.514 20619-21138/com.action.buhsoft W/System.err: at androidx.work.Worker$1.run(Worker.java:85)
2021-01-13 12:40:46.514 20619-21138/com.action.buhsoft W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
2021-01-13 12:40:46.514 20619-21138/com.action.buhsoft W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
2021-01-13 12:40:46.514 20619-21138/com.action.buhsoft W/System.err: at java.lang.Thread.run(Thread.java:776)
2021-01-13 12:40:46.515 20619-21138/com.action.buhsoft W/System.err: Caused by: java.security.cert.CertificateException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading DownloadWorker.java at lines 279 and 193, then trace the HttpsURLConnection request shown in the log. Reproduce the download failure with the reported certificate error and define done as a successful download without the SSLHandshakeException.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, flutter, kotlin
Domain
mobile, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.