Protocol https not supported or disabled in libcurl using Git

半世苍凉 提交于 2020-01-01 04:35:09

问题


I have a few github repos and they have been working fine for the last few months.
However, a few days ago I started getting a strange error when trying to push
and pull:

error: Protocol https not supported or disabled in libcurl while
accessing https: ... fatal: HTTP request failed

I have not changed anything that I am aware of, so not sure
where the error is coming from. Thanks in advance.


回答1:


This error appears if you install Pure Data, may be it's your case.Here is described conflict between Pure Data and git. Pure Data installer put it's own libcurl-4.dll in system32 folder.

Even if you didn't install Pure Data there is probably another libcurl-4.dll somwhere in your library path which is loaded before libcurl-4.dll from installed git location.




回答2:


The first answer is correct though in my case it was not PureData and I even couldn't found what program was conflicting. So I searched the libcurl.dll in C drive and cut it from SysWOW64 folder and pasted on desktop. Looked into its details and it was by some "shenzhen moyea software" which on google led me to youtube converted once installed by my lil bro. Anyways removing the file made the git working again.




回答3:


Maybe you have different libcurl.dll versions installed and one of them is overwriting the github one(that does support https).

I don't know what's your OS, but in windows you have to change the PATH settings, so it will point to the right libcurl.dll (do a libcurl search on c:\ to know where is the github one).

In my case it was the Pure Data install that messed up with libcurl.dll from github.

Hope it helps.




回答4:


I had the same behaviour. I don't know why but I solved it by changing the Repo orign to ssh/git protocol




回答5:


If someone unable to solve the libcurl issue, you can apply this fix

  1. Edit .git/config file under your repo directory
  2. Find url= entry under section [remote "origin"]
  3. Get the ssh url from github for your repository and replace the https url in the config file
  4. Save config file and close it. Now you can use git.



回答6:


I had the same error on macos and homebrew. When i tried-> git clone ... the return was:

fatal: unable to access 'https://github.com/....': Protocol https not supported or disabled in libcurl

I did:

rm '/usr/local/bin/git'

as it mentioned on:

brew link git    

Then i did a git clone again and a keychain popup box appeared and cklicked accept.Then it worked.




回答7:


Solved the problem by removing "git" from the path C:\Program Files\Git\bin

Best Regards.




回答8:


In Windows (10) I was having same issue, in my system even http also didn't worked, I fixed this installing OpenSSL for windows. which I obtained from here

Hope this will help future visitors fixing the issue in straight forward way.




回答9:


Perhaps you messed with LD_LIBRARY_PATH

I built a package that re-pointed the environmental variable LD_LIBRARY_PATH in my ~/.bash_profile. This broke my git; I got the aforementioned libcurl error due to gits dependency on curl:

[user@host folder]$ git push
fatal: unable to access 'https://x-access-token:67bada156da713b46d4d64fe37309cb9c5856717@github.com/project/repository.git/': Protocol https not supported or disabled in libcurl

The solution is to fix LD_LIBRARY_PATH as you run git with an alias:

# Fix problem with libcurl
alias git="LD_LIBRARY_PATH=/usr/local/lib git"

export LD_LIBRARY_PATH=/opt/project/lib

And then...

[user@host folder]$ source ~/.bash_profile
[user@host folder]$ git push
Counting objects: 24, done.
Delta compression using up to 32 threads.
Compressing objects: 100% (9/9), done.
Writing objects: 100% (13/13), 1.57 KiB | 0 bytes/s, done.
Total 13 (delta 5), reused 0 (delta 0)
remote: Resolving deltas: 100% (5/5), completed with 5 local objects.
To https://x-access-token:67bada156da713b46d4d64fe37309cb9c5856717@github.com/project/repository.git/
   676a842..eb37cb9  enhance-0052 -> enhance-0052


来源:https://stackoverflow.com/questions/15553161/protocol-https-not-supported-or-disabled-in-libcurl-using-git

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