【PHP】無法抓取Git套件 Composer SSL certificate problem…Composer:Failed to execute git clone –mirror

若是自行架設 GitLab, 並開發私有的 Composer Package, 在進行 Composer 存取依賴時, 可能會出現以下錯誤

錯誤1

[RuntimeException]
Failed to execute git clone --mirror 'https://xxx:***@192.168.1.10:9876/xxx/xxx.git' '/root/.composer/cache/vcs/https---192.168.1
.10-9876-xxx-xx-xxx.git/'

Cloning into bare repository '/root/.composer/cache/vcs/https---192.168.1.10-9876-xxx-xx-xxx.git'...
fatal: unable to access 'https://xxx:***@192.168.1.10:9876/xxx/xx_xxx.git/': server certificate verification failed. CAfile: /etc/ss
l/certs/ca-certificates.crt CRLfile: none

錯誤2

SSL certificate problem: self signed certificate

解決方法, 只需執行指令「git config –global http.sslVerify false」即可排除

留言

Top