java - 从 5.4 升级到 6.8.3 后如何解决 gradle tls 连接问题?
问题描述
我将项目 Gradle 版本从 5.4.1 升级到 6.8.3,并将自定义存储库更改为 https。
我在 maven 上遇到了类似的问题,但是在镜像解决之后。我可以使用 gradle 5.4.1 毫无问题地构建项目,但是当我将 gradle 升级到 6.8.3 时,出现以下错误:
The server may not support the client's requested TLS protocol versions: (TLSv1.2). You may need to configure the client to allow other protocols to be used.
See: https://docs.gradle.org/6.8.3/userguide/build_environment.html#gradle_system_properties
> sun.security.validator.ValidatorException:
PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
解决方案
PKIX 路径构建失败:sun.security.provider.certpath.SunCertPathBuilderException:无法找到请求目标的有效证书路径
当 JRE 缺少证书时,您会收到此消息。我认为您将不得不在 docker 映像的 JRE 中安装您公司的证书
您的 Dockerfile 将需要执行以下操作:
FROM adoptopenjdk/openjdk11:jre-11.0.11_9-alpine
// my-company.crt is your company's certificate
COPY my-company.crt my-company.crt
RUN keytool -cacerts -storepass changeit -noprompt -trustcacerts -importcert -alias begoroot -file my-company.crt
推荐阅读
- scala - 转换字符串并与 DF 列值 Spark Scala 进行比较
- firebase - 无法使用 Firebase Web Flutter 进行身份验证
- python - Pyspark:将列值与另一个值进行比较
- visual-studio-code - VS Code - 比较显示通知已到达文件末尾
- regex - 正则表达式匹配点开始后的可选值
- sql - 使用 datetimeoffset 时 SQL Server 行为发生变化
- python - 使用 youtube_dl 库和 Python 在 vlc 中流式传输 youtube 视频
- testing - 使用 X 射线云操作测试步骤
- c# - 时间:2019-05-10 标签:c#negation operator open括号
- r - 如何使用 R 批量查询数据