前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >关于Gradle7.0及以上版本报Https的错误的解决方案

关于Gradle7.0及以上版本报Https的错误的解决方案

作者头像
xiangzhihong
发布2022-05-06 08:59:16
1K0
发布2022-05-06 08:59:16
举报
文章被收录于专栏:向治洪向治洪

今天在升级Android项目的gradle时,遇到如下的一个错误:

在这里插入图片描述
在这里插入图片描述

官方的解释是:

代码语言:javascript
复制
Specifies whether it is acceptable to communicate with a repository over an insecure HTTP connection.

For security purposes this intentionally requires a user to opt-in to using insecure protocols on case by case basis.

Gradle intentionally does not offer a global system/gradle property that allows a universal disable of this check.

*Allowing communication over insecure protocols allows for a man-in-the-middle to impersonate the intended server, and gives an attacker the ability to [serve malicious executable code onto the system.](https://max.computer/blog/how-to-take-over-the-computer-of-any-java-or-clojure-or-scala-developer/)*

大概意思是为了安全,需要要升级成Https,修改的方式有两种。一种是将maven的http修改成为https,另一种是忽略警告,在maven中添加allowInsecureProtocol,比如:

代码语言:javascript
复制
maven {
            allowInsecureProtocol = true
            url 'http://developer.huawei.com/repo/'
}
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2022-04-06,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档