git SSL certificate problem

今天在某台 centos 的伺服器上遇到這(下面這段)問題,看似 certificate 的問題,去 google 一下會發現超多種解決方式,看似非常複雜但其實有更快的 workaround。

error: SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed while accessing http://github.com/xxxxxxxxxxxxx


這問題應該會發生在 git clone 或 npm install 時,某些 package 造成,但其實就是 certificate 出錯,如果是 git 最快速的解決方式
GIT_SSL_NO_VERIFY=true git clone https://github.com/.......

但是如果是 npm 並沒有辦法這樣下,所以要用另外的方式
export GIT_SSL_NO_VERIFY=true
npm install

沒有留言:

張貼留言