问题
I'm using Gitlab and Visual Studio 2015 and when I push my changes to Gitlab projects, I receive the next error:
The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
Inner Exception:
The remote certificate is invalid according to the validation procedure.
To setup my project, I followed the next steps:
- Create a project in Gitlab.
Clone this project into my folder. In this step I needed to use the next command:
git config --global http.sslVerify false
I created a project into this folder.
- I have reviewed the repository settings and remotes is correct.
- I did a commit to local repository.
- I have tried to push this commit into remote and I have had the above-mentioned error.
回答1:
As far as I know Visual Studio uses LibGit2 to handle the security checks and while it has one function to validate the connection, it's never used and ifdeffed out.
If I remember correctly Visual Studio wraps the connection, but there is no setting to disable SSL security in the product.
Instead
- why not fix the certificate, a SSL certificate is not as expensive as it used to be
- why not add the certificate to the trusted certificate's list of your user by importing it in the Windows Certificate Store as a trusted Root Certificate?
- if your cert is valid, why not ensure that you're usign the correct remote name
来源:https://stackoverflow.com/questions/36571292/visual-studio-2015-and-git-the-underlying-connection-was-closed-could-not-esta