更新时间:2023-11-30 18:30:22
问题是Java进程没有认证证书.
The Problem was that the Java process didn't have the certificate for authentication.
在我的第一种方法中,我非常接近,但我忘记添加公司的根 CA 证书.我公司的私有证书属于根CA,所以两者都必须提供给java.
In my first approach I came very close but I forgot to add the company's root CA cert. My company's private certificate belongs to the root CA, so both must be provided to java.
解决方案:
首先将您的私人公司证书提供给 gradle 过程.
First provide your private company certificate to the gradle process.
编辑您的用户 gradle.properties 并添加
Edit your user gradle.properties and add
org.gradle.jvmargs=-Djavax.net.ssl.keyStore="/Users/myusername/certificates/my_private_company_cert.p12" -Djavax.net.ssl.keyStoreType=KeychainStore -Djavax.net.ssl.keyStorePassword=changeit
然后将贵公司的根 ca 证书导出到 java 密钥库.
Then export your company's root ca cert to the java keystore.
sudo keytool -import -trustcacerts -alias root -file ./certificates/company_root_ca.crt -keystore $JAVA_HOME/jre/lib/security/cacerts
这就是证书身份验证现在应该可以工作了.
Thats it certificate authentication should now work.
这用于例如制作自己的 android 库项目并将它们推送到工件服务器.https://medium.com/android-news/the-complete-guide-to-creating-an-android-library-46628b7fc879#.naboz7yng
This is used for example to make own android libary projects and push them to a artifact server. https://medium.com/android-news/the-complete-guide-to-creating-an-android-library-46628b7fc879#.naboz7yng