我正在使用 gradle 构建系统。
我的 Maven 仓库是这样配置的
maven {
allowInsecureProtocol = true
url 'https://nexus.local.intranet/repository/maven-releases/'
credentials {
username ''
password ''
}
}
maven 存储库是 nginx 背后的纽带。
我收到此错误
> The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.4.2/userguide/build_environment.html#gradle_system_properties
> PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
当我在浏览器中打开网址时,它正在工作。
有什么建议吗?
最佳答案
自签名证书必须存储在 java keystore 中,如下所示:
从服务器下载证书:
echo -n | openssl s_client -connect nexus.local.intranet:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /tmp/local.intranet.crt
导入 keystore
keytool -import -trustcacerts -keystore /usr/lib/jvm/java-17-openjdk-amd64/lib/security/cacerts -storepass changeit -noprompt -alias local.intranet -file /tmp/local.intranet.crt
关于java - 使用自签名证书的 gradle Nexus,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73209638/