scala sbt and corporate proxy - SunCertPathBuilderException

前端 未结 5 657
太阳男子
太阳男子 2020-12-06 01:44

When I try to use SBT some files cannot be downloaded with the following error:

Server access Error: sun.security.validator.ValidatorException: PKIX

5条回答
  •  自闭症患者
    2020-12-06 02:31

    So this happens when you are behind a proxy and we need the proxy server certificate to be added to the java truststore

    cp $JAVA_HOME/jre/lib/security/cacerts /
    # Get the certificate of the proxy server and store it in a file-proxy.pem
    keytool -keystore cacerts -import -file proxy.pem -alias my_proxy
    # Now we can invoke sbt with following config
    sbt  "-Djavax.net.ssl.trustStore=/path/to/included/proxycert/cacerts" compile
    

提交回复
热议问题