guodong's blog

master@zhejiang university
   

bazel 踩过的坑

使用bazel编译测试时,会跳出诸如下面的错误:

ERROR: /kernels/
BUILD:7:1: no such package ‘@com_google_googletest//’: Error downloading [https:
//github.com/google/googletest/archive/master.zip] to /ehqszzsi/external/com_google_googletest/master.zip: sun.security.valid
ator.ValidatorException: PKIX path building failed: sun.security.provider.certpa
th.SunCertPathBuilderException: unable to find valid certification path to reque
sted target and referenced by ‘//mesh_renderer/kernels:rasterize_triangles_impl_
test’

网上查找有关信息:参看这五个链接,(第三四五个链接必看)

https://github.com/oracle/graal/issues/493
https://github.com/bazelbuild/bazel/issues/3993
https://github.com/tensorflow/tensorflow/issues/7497#issuecomment-298828704
https://stackoverflow.com/questions/21076179/pkix-path-building-failed-and-unable-to-find-valid-certification-path-to-requ
http://magicmonster.com/kb/prg/java/ssl/pkix_path_building_failed.html

首先找到证书的位置:$JAVA_HOME/jre/lib/security/cacerts 然后使用浏览器访问提示错误的HTTPS URL,浏览器网址栏左侧有证书,然后导出证书。不同的java版本有着不同的证书。

If you do not want to modify the default JRE store, you can make a copy, and use the following system properties to specify the location and password.

javax.net.ssl.trustStore
javax.net.ssl.trustStorePassword

Assuming the file is called example.der, pick the alias ‘example’ for this certificate. Next import the file.

keytool -import -alias example -keystore  /path/to/cacerts -file example.der

You will be prompted for a password, use ‘changeit’

and respond “yes” on whether to trust this key.

最后结果是:




上一篇:
下一篇:

头像

guodong

说点什么

avatar
  Subscribe  
提醒