在eclipse Neon上安装aws toolkit时如何解决连接问题?

use*_*603 6 eclipse toolkit amazon-web-services

我在一家公司,需要设置代理才能上网。代理设置没问题,因为我可以连接到其他网站,例如 Neon - http://download.eclipse.org/releases/neon,但不能连接到http://aws.amazon.com/eclipse

错误信息是:

无法在https://aws.amazon.com/eclipse/content.xml读取存储库 。无法在https://aws.amazon.com/eclipse/content.xml读取存储库。sun.security.validator.ValidatorException:PKIX 路径构建失败:sun.security.provider.certpath.SunCertPathBuilderException:无法找到请求目标的有效认证路径。

具体堆栈为:

javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException:PKIX 路径构建失败:sun.security.provider.certpath.SunCertPathBuilderException:无法在 sun.security.ssl.Alerts.getSSLException 处找到请求目标的有效认证路径(未知来源)位于 sun.security.ssl.SSLSocketImpl.fatal(未知来源)位于 sun.security.ssl.Handshaker.fatalSE(未知来源)位于 sun.security.ssl.Handshaker.fatalSE(未知来源)位于 sun.security .ssl.ClientHandshaker.serverCertificate(Unknown Source) at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source) at sun.security.ssl.Handshaker.processLoop(Unknown Source) at sun.security.ssl.Handshaker.process_record(Unknown)来源)在 sun.security.ssl.SSLSocketImpl。readRecord(Unknown Source) at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source) at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source) at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source) at org. apache.http.conn.ssl.SSLSocketFactory.createLayeredSocket(SSLSocketFactory.java:554) 在 org.apache.http.conn.ssl.SSLSocketFactory.createLayeredSocket(SSLSocketFactory.java:435) 在 org.apache.http.impl.conn。 DefaultClientConnectionOperator.updateSecureConnection(DefaultClientConnectionOperator.java:216) at org.apache.http.impl.conn.ManagedClientConnectionImpl.layerProtocol(ManagedClientConnectionImpl.java:394) at org.apache.http.impl.client.DefaultRequestDirector.establishRoute(DefaultRequestDirector.java: 814) 在 org.apache.http.impl.client。DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:615) at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:446) at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java: 863) 在 org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82) 在 org.eclipse.ecf.provider.filetransfer.httpclient4.HttpClientFileSystemBrowser.runRequest(HttpClientFileSystemBrowser.java:263) 在 org.eclipse .ecf.provider.filetransfer.browse.AbstractFileSystemBrowser$DirectoryJob.run(AbstractFileSystemBrowser.java:69) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) 引起:sun.security.validator .ValidatorException:PKIX 路径构建失败:sun.security.provider.certpath.SunCertPathBuilderException:无法在 sun.security.validator.PKIXValidator.doBuild(Unknown Source) at sun.security.validator.PKIXValidator.engineValidate(Unknown Source) at sun.security.validator.Validator.validate(Unknown Source) 找到请求目标的有效认证路径) 在 sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source) at sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source) at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source) ... 20 多个: sun.security.provider.certpath.SunCertPathBuilderException: 无法在 sun.security.provider.certpath.SunCertPathBuilder 的 sun.security.provider.certpath.SunCertPathBuilder.build(Unknown Source) 找到请求目标的有效认证路径。engineBuild(Unknown Source) at java.security.cert.CertPathBuilder.build(Unknown Source) ... 26 更多

pos*_*rux 5

这是因为 java 无法识别https://aws.amazon.com的根证书颁发机构 (CA) SSL 证书的根证书颁发机构 (CA) SSL 证书。

\n\n

解决方案是将该证书添加到 java cacerts 文件中,以便它被永久接受。

\n\n

步骤1:获取根证书https://aws.amazon.com的根证书

\n\n

铬浏览器

\n\n
    \n
  1. 打开https://aws.amazon.com
  2. \n
  3. 从上下文菜单中选择“检查”(右键单击页面)并导航到“安全”选项卡
  4. \n
  5. 点击查看证书
  6. \n
  7. 单击层次结构中最顶层的证书,并确认它带有根 CA 短语。
  8. \n
  9. 将您在桌面上看到的书面证书图像拖放到桌面上。
  10. \n
\n\n

火狐浏览器

\n\n
    \n
  1. 打开https://aws.amazon.com
  2. \n
  3. 单击绿色锁定按钮“显示证书”
  4. \n
  5. 选项卡“详细信息”、“导出”
  6. \n
\n\n

就是这样!您已获得根证书!

\n\n

第 2 步:将该证书添加到 java cacerts 文件中。

\n\n
    \n
  1. 在 jre bin 文件夹中使用 keytool.exe。
  2. \n
  3. 触发以下命令将您的证书放入 cacerts 文件中
  4. \n
\n\n
\n

keytool \xe2\x80\x93import \xe2\x80\x93noprompt \xe2\x80\x93trustcacerts \xe2\x80\x93alias ALIASNAME -file\n /PATH/TO/YOUR/DESKTOP/CertificateName.cer -keystore\n /PATH/TO /YOUR/JDK/jre/lib/security/cacerts -storepass changeit

\n
\n\n

这就对了!你的问题已经解决了。

\n\n

请注意

\n\n
    \n
  1. 请确认给您带来此 PKIX 错误的 jre(部署后 eclipse 或您的应用程序使用的 JRE)就是您执行步骤 2 的位置。如果您尝试使用另一个 jre,问题将是这样。
  2. \n
\n