SSL certificate problem git in: unable to get local issuer certificate error solution

  When we use git to initiate a project, especially through git submodule update --init --remote initialization sub-module, you may encounter the following error:

fatal: unable to access 'https://myserver.com/gogs/user1/myapp/': SSL certificate problem: unable to get local issuer certificate

  This is because when you access a remote Git repository via HTTPS, SSL certificate on the server if not through a third-party certification bodies, git will error. The reason is because the certificate is not signed the unknown may mean there is a big risk. The solution is to git in sslverify the following command will turn off:

git config --global http.sslverify false

  The scope of the above command line is the current system users, if you want to set a global to all users, you can change it to this:

git config --system http.sslverify false

  If you just want to set for the current warehouse and can be performed under the need to modify the repository directory:

git config http.sslverify false

  If there are nested git submodule your repository (that is, sub-modules and sub-modules references), during initialization, there are still likely to encounter self signed certificate in certificate chain of error, this time by executing the following command to resolve:

npm config set strict-ssl false

  For npm, in addition you can customize the script in the scripts of the property package.json outside, npm-scripts also built a number of scripts to perform certain tasks in a specific time, specific reference may be made an official document of npm https : //docs.npmjs.com/misc/scripts

Guess you like

Origin www.cnblogs.com/jaxu/p/12027839.html