Artifactory https 证书信任

问题:
Artifactory fails to make secure connection to a remote URL (e.g. when Test button is clicked at Admin => Repositories => your repository => Test =>Artifactory UI displays “Connection failed with exception: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target” error )

REASON: The error is caused because JAVA that Artifactory runs on does not have root certificate of the remote URL trusted on its trusted root certificate store.

RESOLUTION:

NOTE: For Artifactory High Availability, perform the following steps at all of the HA nodes,

  1. Get remote site’s root and intermediate certificates by running openssl s_client -showcerts -connect <REMOTE_URL>:<REMOTE_PORT>

For example, openssl s_client -showcerts -connect google.com:443

  1. Save each certificate as a file

For example,

s:/C=US/ST=North Carolina/L=Raleigh/O=Red Hat, Inc./OU=Red Hat Network/CN=Entitlement Master CA/emailAddress=ca-support@redhat.com
i:/C=US/ST=North Carolina/L=Raleigh/O=Red Hat, Inc./OU=Red Hat Network/CN=Entitlement Master CA/emailAddress=ca-support@redhat.com

The example above indicates that the issuer (i:) is the same as the subject (s:), which indicates that it is the root certificate.
Save the hash of the certificate (include —–BEGIN CERTIFICATE—– and —–END CERTIFICATE—– ) and save it as root.crt .

  1. Identify which JVM that Artifactory runs on

  2. Import root and intermediate certificates to the trusted root certificate of the JAVA found above (usually called “cacerts”) by using keytool import command. For more information, please visit https://docs.oracle.com/cd/E19830-01/819-4712/ablqw/index.html

For example,
sudo keytool -importcert -keystore /usr/local/java/jdk1.8.0_60/jre/lib/security/cacerts -storepass changeit -file ~/Downloads/RHEL-cert/root.crt -alias “rhel-root”

  1. Verify the change at Admin => Repositories => your remote repository => Test => If it still fails then you may need to restart Artifactory for the change to take effect
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值