• 欢迎订阅我的Youtube频道
  • 欢迎加入我的电报群

SBT dependency download problem

软件开发 fennng 6个月前 (04-06) 318次浏览 0个评论

When run SBT, none of the dependencies can be downloaded.

I got this error:

Server access Error: sun.security.validator.ValidatorException: PKIX path
building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find
valid certification path to requested target url=

The reason is that the HTTP client used by JAVA doesn’t trust any HTTPS
certificate. You have to add all the certificates to the trustStore.

Solution:

Instead of adding many certificates. I only added fiddler’s certificate.
This is a easier way to do it. I enable SSL decryption on my Fiddler
(windows). This will make fiddler to resign all the packets. Then I export
fiddler’s root certificate to the desktop.

Use the following command to generate a keystore file.

keytool -import -file %userprofile%\Desktop\FiddlerRoot.cer -keystore
FiddlerKeystore -alias Fiddler

I then copy this keystore file to the project folder.

Set the SBT_OPTS environment as below.

export SBT_OPTS="$SBT_OPTS -Dhttps.proxyHost=192.168.1.69 -Dhttps.proxyPort=8888 -Djavax.net.ssl.trustStore=/Users/fengnz/FiddlerKeystore -Djavax.net.ssl.trustStorePassword=yourpassword"

Then run sbt command again, the problem resolved.

And I can see all the downloading from Fiddler too.


峰享技术 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:SBT dependency download problem
喜欢 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址