以下是连接到 Anypoint Exchange、设计中心、Studio、连接器、Munit、Runtime 更新或将应用程序部署到 Cloudhub 时,Anypoint Studio 中记录的两种不同类型的 SSLHandshakeException 错误。
javax.net.ssl.SSLHandshakeException: org.eclipse.ecf.internal.ssl.ECFCertificateException:有效的证书链,但找不到信任证书!
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException:PKIX 路径构建失败:sun.security.provider.certpath.SunCertPathBuilderException:找不到所请求目标的有效认证路径
请注意,UI 可能会显示一般的无法访问、下载或访问被拒绝错误。证书错误是在 Anypoint Studio 中捕获的。有关如何查看 Anypoint Studio 的更多信息,请参考如何检索 Studio 错误日志。
注意: 如果仅在使用 VPN 时出现错误,请确保在完成所有这些步骤之前连接到 VPN。
步骤:
在计算机上创建一个文件夹来下载/存储证书
打开浏览器并转到 https://anypoint.mulesoft.com/login(和/或任何其他在访问时显示错误的 URL,例如 studio.mulesoft.org 或 download.eclipse.org)
对于 Windows:单击详细信息,然后复制到文件。使用证书导出向导将所有证书下载到新文件夹中。
复制保存证书的文件夹路径,并将其粘贴到文本编辑器中。
对于 Mac:若要在 Mac 中复制路径,请打开查找器,右键单击或选择控制,然后单击您需要路径的文件夹或文件,按住 OPTION 键,您应该会看到“复制为路径名”选项。
对于 Windows:要在 Windows 中复制路径,请打开查找器,导航到需要路径的文件夹或文件,单击查找器顶部显示位置的区域,它应该允许您复制路径。
在文本编辑器中,复制/粘贴以下命令。
请注意,您需要为每个证书创建一个 keytool 命令。例如,在上面的例子中,您将需要两个 keytool 命令,一个用于 Amazon,一个用于 Amazon CA Root 1。keytool 命令的数量将根据您拥有的证书数量(通常为 2 或 3)而有所不同。
提示:如果有三个证书,建议将下面的示例 keytool 命令作为新行复制/粘贴到文本编辑器中四次,这样可以保留一行作为示例,并为每个证书编辑其他行。这里有一个示例:
对于 Mac:keytool -importcert -file pathToFolder/ -keystore JDKpath/Contents/Home/lib/security/cacerts -alias ""
对于 Windows:keytool -importcert -file C:\Users\TestUser\Downloads\Mulesoft_Certificates\Zscaler_Root_CA.crt -keystore C:\Users\TestUser\Downloads\AnypointStudio718\plugins\org.mule.tooling.jdk.win32.x86_64_1.3.1\lib\security\cacerts -alias “Zscaler_Root_CA”
在显示 pathToFolder 的地方插入文件夹路径。在显示 的地方插入证书名称。
对于Mac:keytool -importcert -file /Users/myName/cert/amazon.cer -keystore JDKpath/Contents/Home/lib/security/cacerts -alias "amazon.cer"
对于 Windows:keytool -importcert -file /Users/myName/cert/amazon.cer -keystore JDKpath\lib\security\cacerts -alias "amazon.cer"
打开 Anypoint Studio .ini 文件。有关如何打开此文件的更多信息,请参考如何找到 AnypointStudio ini 文件。
转到安装 Studio 的文件夹,然后导航到插件,现在找到 .ini 文件中列出的 JDK 文件夹。它将是一个以“org.mule.tooling.jdk”开头的文件夹。在示例屏幕截图中,"org.mule.tooling.jdk.macosx.x86_64_1.1.1"是 JDK 文件夹,
对于 Windows:它类似于:
将路径复制到 .ini 文件中列出的 JDK,在文本编辑器中,将 JDKpath 替换为复制的路径。这是完整命令的外观。
对于 Mac:keytool -importcert -file /Users/myName/cert/Amazon.cer -keystore /Applications/AnypointStudio710.app/Contents/Eclipse/plugins/org.mule.tooling.jdk.macosx.x86_64_1.1.1/Contents/Home/lib/security/cacerts -alias "Amazon.cer"
对于:keytool -importcert -file /Users/myName/cert/amazon.cer -keystore /Applications/AnypointStudio710.app/Contents/Eclipse/plugins/org.mule.tooling.jdk.win32.x86_64_1.1.1\lib\security\cacerts -alias "amazon.cer"
对下载的所有证书复制该命令。确保每个证书都有唯一的一行。 例如,如果您正在使用 Mac,并且有三个证书和一个名为“cert”的文件夹,您应该有三个独特的命令,如下所示。确保包含“cacerts”:
keytool -importcert -file /Users/myName/cert/certificate_1.cer -keystore /Applications/AnypointStudio710.app/Contents/Eclipse/plugins/org.mule.tooling.jdk.macosx.x86_64_1.1.1/Contents/Home/lib/security/cacerts -alias "certificate_1.cer"
keytool -importcert -file /Users/myName/cert/certificate_2.cer -keystore /Applications/AnypointStudio710.app/Contents/Eclipse/plugins/org.mule.tooling.jdk.macosx.x86_64_1.1.1/Contents/Home/lib/security/cacerts -alias "certificate_2.cer"
keytool -importcert -file /Users/myName/cert/certificate_3.cer -keystore /Applications/AnypointStudio710.app/Contents/Eclipse/plugins/org.mule.tooling.jdk.macosx.x86_64_1.1.1/Contents/Home/lib/security/cacerts -alias "certificate_3.cer"
以管理员身份打开 Mac 中的终端或 Windows 中的命令提示符。您可以在任何目录下。粘贴在前一节中创建的每个 keytool 命令,一次粘贴一个。
输入密码“changeit”。密码全部小写,没有空格。
如果询问您是否信任该证书,请键入“y”。
运行命令后,重启 Studio。
即使在安装了证书之后,如果 Windows 上的证书错误仍然存在,请联系您的 IT 团队将 Studio URL 列入白名单。有关更多信息,请参考要运行 Anypoint Studio,我的 IT 团队需要将哪些 URL 列入白名单?
HTTPS 调用失败,出现“SunCertPathBuilderException:找不到请求目标的有效证书路径”或“一般的 SSLEngine 问题”
001122500

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.