-->

Getting SSL error when attempting to clone a Stash

2019-04-12 22:37发布

问题:

I'm attempting to clone a git repository hosted in Stash, but having no luck.

I get the following error:

fatal: unable to access 'https://xxx@stash.xxx.com/scm/yyy/yyy.git/': SSL certificate problem: Invalid certificate chain

I confirmed that I have access to the repository by logging into Stash and viewing it through my browser.

I also loaded the private key for that repository using ssh-add.

回答1:

Solved it! (With a little help from this question, but a slightly different solution.)

  1. Browse to the repository in Stash.

  2. Click the little 'https' icon in the address bar. Click Show Certificate. Drag the little certificate icon onto the desktop.

  3. Open the Keychain Access utility (type it into Finder). In the Keychains list, select the bold item, and under Category, select Certificates.

  4. Drag the certificate from the desktop into the list, so that it gets added.

  5. Right-click the certificate, click Get Info. Expand the Trust section (click the little triangle) and in the top drop-down, select Always Trust. Close the window and ensure the changes get saved.