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

HTTPS方式无法下载 #87

Open
maxrks opened this issue Apr 12, 2021 · 0 comments
Open

HTTPS方式无法下载 #87

maxrks opened this issue Apr 12, 2021 · 0 comments

Comments

@maxrks
Copy link

maxrks commented Apr 12, 2021

使用App内下载,设置manifest如下,调用HTTPS下载路径时出错。

android:networkSecurityConfig="@xml/network_security_config"
android:usesCleartextTraffic="true"


<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <base-config cleartextTrafficPermitted="true">
        <trust-anchors>
            <certificates src="system" />
        </trust-anchors>
    </base-config>
</network-security-config>

日志错误如下:

E/[UpdateAppUtils]: ----使用FileDownloader下载-------
    pending:soFarBytes(0),totalBytes(0)
E/[UpdateAppUtils]: 下载出错,尝试HTTPURLConnection下载
E/[UpdateAppUtils]: ----使用HttpURLConnection下载----
D/NetworkSecurityConfig: Using Network Security Config from resource network_security_config debugBuild: true
E/[UpdateAppUtils]: HttpURLConnection下载失败:java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
E/[UpdateAppUtils]: error:java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
E/[UpdateAppUtils]: 删除成功

使用浏览器方式下载没问题。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant