SBT dependency download problem

  • fennng 

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

I got this error:

Server access Error: PKIX path
building failed: 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.


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= -Dhttps.proxyPort=8888"

Then run sbt command again, the problem resolved.

And I can see all the downloading from Fiddler too.