6

我正在使用本地 Sonaty Nexus 代理几个外部 Maven 存储库。到目前为止,代理的只有 http 存储库,但对于某些工件,我不得不介绍Camunda。使用 Nexus 远程内容浏览器,我可以浏览其内容,但 Nexus 不下载其索引。不仅如此,nexus 日志中还会出现以下错误:

2014-01-08 11:44:27 WARN  [xy-3-thread-218] - org.sonatype.nexus.proxy.maven.maven2.M2Repository - Remote peer of proxy repository "Camunda Secure" [id=camunda.secure] threw a org.sonatype.nexus.proxy.RemoteStorageException exception. Connection/transport problems occured while connecting to remote peer of the repository. - Cause(s): Transport error while executing GET method [repositoryId="camunda.secure", requestPath="/", remoteUrl="https://app.camunda.com/nexus/content/groups/public/"] > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target > unable to find valid certification path to requested target
2014-01-08 11:44:44 ERROR [tp13549765-1372] - org.sonatype.nexus.proxy.maven.maven2.M2Repository - Got RemoteStorageException in proxy repository "Camunda Secure" [id=camunda.secure] while retrievingremote artifact "ResourceStoreRequest(requestPath="/.meta/repository-metadata.xml")" from URL https://app.camunda.com/nexus/content/groups/public/, this is 1 (re)try, cause: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
2014-01-08 11:44:44 ERROR [tp13549765-1372] - org.sonatype.nexus.proxy.maven.maven2.M2Repository - Got RemoteStorageException in proxy repository "Camunda Secure" [id=camunda.secure] while retrievingremote artifact "ResourceStoreRequest(requestPath="/.meta/repository-metadata.xml")" from URL https://app.camunda.com/nexus/content/groups/public/, this is 2 (re)try, cause: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
2014-01-08 11:44:44 ERROR [tp13549765-1372] - org.sonatype.nexus.proxy.maven.maven2.M2Repository - Got RemoteStorageException in proxy repository "Camunda Secure" [id=camunda.secure] while retrievingremote artifact "ResourceStoreRequest(requestPath="/.meta/repository-metadata.xml")" from URL https://app.camunda.com/nexus/content/groups/public/, this is 3 (re)try, cause: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
2014-01-08 11:44:44 WARN  [tp13549765-1372] - org.sonatype.nexus.proxy.maven.maven2.M2Repository - Remote peer of proxy repository "Camunda Secure" [id=camunda.secure] threw a org.sonatype.nexus.proxy.RemoteStorageException exception. Connection/transport problems occured while connecting to remote peer of the repository. - Cause(s): Transport error while executing GET method [repositoryId="camunda.secure", requestPath="/.meta/repository-metadata.xml", remoteUrl="https://app.camunda.com/nexus/content/groups/public/.meta/repository-metadata.xml"] > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target > unable to find valid certification path to requested target

我应该怎么做才能下载它的索引并在我的 Maven 项目中引用这些工件?

SK

4

5 回答 5

8

这里的底线: -

您的 maven 无法在 keystore 中找到它尝试连接的服务器的证书,比如 foo.domain.com 。

解决步骤

1) 确定您的 Maven 正在使用的密钥库 - 这非常重要。因为您可能会继续将证书添加到密钥库,但不会添加到 Maven 寻找的那个

这里的提示:-

a) 如果不涉及特定配置,则应查看默认的 JDK 密钥库 - JAVA_HOME 中的 caccerts

b)如果您在 /Users/username/ 下配置了 .mavnerc,这将覆盖默认设置。所以一定要看看这里知道它指向哪里

2) 使用 keytool 命令下载证书并导入正确的密钥库

keytool -import -alias alias_name -file certificate_name -keystore keystorelocation
于 2014-05-31T03:13:56.520 回答
7

您需要将相应的 SSL 证书导入您的密钥库。

在linux上下载证书:

openssl s_client -showcerts -connect app.camunda.com:443 </dev/null 2>/dev/null|openssl x509 -outform PEM > mycertfile.pem

将证书导入您的 java 密钥库。请参阅https://www.sslshopper.com/article-most-common-java-keytool-keystore-commands.html怎么做。

于 2014-06-05T08:30:24.917 回答
2

也许这个关于 SSL 证书的讨论可以帮助你让它工作。如果您一直遇到证书问题,也可以使用以下方式访问 camunda Maven 存储库而无需 SSL 加密:http ://app-unsecure.camunda.com/nexus/content/groups/public/

于 2014-01-09T09:41:12.703 回答
0
Download the certificate from Nexus Browser (click on the lock-pad for View Site Information in case of Microsoft Edge)
Click on Connection is secure
Click on the certificate details
Click on Copy To file (it opens up export certificate wizard)
Choose Base-64 encoding
Browse and select a download location and file-name (let’s say mycert)
Open cmd
Goto the download location and execute the below command
keytool -import -alias mycert -keystore  "<<your-JAVA_HOME-directory>>\jre\lib\security\cacerts" -file mycert.cer
Restart the machine
Execute maven build again.
于 2021-12-10T16:16:12.947 回答
-1

看看管理员安全,也许你还没有证书。管理员 Nexus 面板。

于 2021-03-10T07:36:41.093 回答