Visual Studio 2015 and Git: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel

倾然丶 夕夏残阳落幕 提交于 2019-12-13 01:56:14

问题


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:

  1. Create a project in Gitlab.
  2. Clone this project into my folder. In this step I needed to use the next command:

    git config --global http.sslVerify false

  3. I created a project into this folder.

  4. I have reviewed the repository settings and remotes is correct.
  5. I did a commit to local repository.
  6. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!