96

Since a few days I got an issue with Mac OS High Sierra 10.13.3 : When I run a git clone like git clone github.com/xxx.git failed it print:

LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443

Same issue with npm i command Even when I try to install brew like so:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

I also tried the alternative setup: same.

7
  • Possible duplicate of Git pull / push - unable to access HTTPS, SSL Routines seem to be down
    – phd
    Feb 26, 2018 at 12:57
  • 4
    This happened to me since a few days ago. In most of the cases, it fails the first time and succeeds the second time and third time ... Mar 17, 2018 at 2:35
  • Hi @EmileCantero , did you solve the issue? starting last 2 weeks I'm also getting the same error...
    – Daniyar
    Apr 27, 2018 at 11:58
  • 1
    hi guys it's been a while I am not sure how I fix it but I am sure I fix it so I will go search for you and comme back asap with the right infos Apr 30, 2018 at 6:14
  • 1
    It's a general MacOS issue. At some point of time this happens and you can't use SSL anymore. Sometimes you can't open any URL's in your browser anymore. Didn't find any solution so far...
    – Ben Keil
    Apr 1, 2019 at 12:29

28 Answers 28

92

I had this similar error when using wget ..., and after much unfruitful searching in the Internet, I discovered that it was happening when hostnames were being resolved to IPv6 addresses. I discovered this by comparing the outputs of wget ... in two machines, one was resolving to IPv4 and it worked there, the other was resolving to IPv6 and it failed there.

So the solution in my case was to run networksetup -setv6off Wi-Fi on macOS High Sierra 10.13.6. (I discovered this command in this page).

Hope this helps you.

6
  • 3
    what adverse effects can one expect by turning off ipv6?
    – jmm
    Jan 15, 2020 at 11:41
  • 1
    I have IPV6 turned off in my laptop, and since then I have experienced no issues or limitations that I am aware of, so I will keep it turned off. If everything works, then I do not bother turning IPV6 on again.
    – mljrg
    Jan 15, 2020 at 16:58
  • 15
    This solved my problem. If you're concerned, you can turn v6 back on by running networksetup -setv6automatic Wi-Fi.
    – mikey
    Jan 20, 2020 at 19:52
  • This has done my nut for the last few weeks. It has been fine up until then trying to access visualstudio sites in browsers, but most of all only the git command worked once in every 10 or so calls. Not sure what changed in between but I would assumed ipv6 was enabled before.
    – Andez
    Jan 7, 2021 at 22:11
  • OMG. I can't believe I wasted so much time of my life watching super slow brew doing nothing....what the hell?! Thank you for this answer.... Jan 15, 2022 at 6:58
51

Same problem here, it turned out to be my incorrectly configured proxy settings, here's how to check and remove them.

First open your git config file.

vi ~/.gitconfig

and find out whether the [http] or [https] sections are set.

I used to set proxies for git due to slow access to Github in China, however, lately I changed my local proxy ports but I forgot my git settings.

If you have incorrect proxy settings and decide to remove it, simply execute:

git config --global --unset http.proxy
git config --global --unset https.proxy

Things will work just fine.

1
  • Didn't work for me!
    – jtlz2
    Dec 8, 2022 at 20:17
35

I just turned off VPN and it solved the issue.

0
19

Since you're using LibreSSL, try re-installing curl with OpenSSL instead of Secure Transport.


Latest Brew

All options have been removed from the curl formula, so now you need to install via:

brew install curl-openssl

Older Brew

Install curl with --with-openssl:

brew reinstall curl --with-openssl

Note: If above won't work, check brew options curl to display install options specific to formula.


Here are few other suggestions:

  • Make sure you're not using http_proxy/https_proxy.
  • Use -v to curl for more verbose output.
  • Try using BSD curl at /usr/bin/curl, run which -a curl to list them all.
  • Make sure you haven't accidentally blocked curl in your firewall (such as Little Snitch).
  • Alternatively use wget.
5
  • 2
    brew will fail as well as it depends on on LibreSSL as well as curl. Jan 19, 2019 at 23:02
  • 25
    brew reinstall curl --with-openssl get Error: invalid option: --with-openssl
    – Jeff Tian
    Mar 15, 2019 at 10:05
  • 1
    All options have been removed from the curl formula, so you now need brew install curl-openssl
    – cmbuckley
    Jan 13, 2020 at 10:42
  • 1
    I'm currently facing a similar issue (with Homebrew) and came across your post. You say "since you're using LibreSSL", what do you mean by that? I am not explicitly using LibreSSL or OpenSSL, just brew. Is there a way for me to choose between LibreSSL or OpenSSL, or to specify which flavor Brew should use?
    – RocketNuts
    May 9, 2020 at 9:24
  • I'm trying to install brew when I get this error 🥲 Jan 31 at 17:41
12

From https://github.com/Homebrew/brew/issues/4436#issuecomment-403194892

Issue solved by setting this env variable:

export HOMEBREW_FORCE_BREWED_CURL=1
3
  • I get export: `=1': not a valid identifier when running from bash terminal
    – QHarr
    Jun 10, 2020 at 17:39
  • 1
    @QHarr you must have written: export $HOMEBREW_FORCE_BREWED_CURL=1 which is totally different.
    – dlamblin
    Aug 14, 2020 at 2:27
  • @dlamblin Thank you
    – QHarr
    Aug 14, 2020 at 21:22
10

A simple restart fixed it for me. I'm not sure what was the problem since I work with so much software but I have a feeling it was the VPN software or maybe the fact I put my laptop in sleep a lot and some file was corrupted. I really don't know but the restart fixed it.

10

I use ClashX 1.30.2 and I can visit the google.com in Google Chrome.

After I encountered this issue, I click the 'Copy shell command'

Clash screenshot

And I execute the command line copied by the above.

export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890

And it fixed the issue.


Before I encounted the issue.
➜  octopus brew services start jenkins-lts
==> Tapping homebrew/services
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-services'...
fatal: unable to access 'https://github.com/Homebrew/homebrew-services/': LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
Error: Failure while executing; `git clone https://github.com/Homebrew/homebrew-services /usr/local/Homebrew/Library/Taps/homebrew/homebrew-services --origin=origin` exited with 128.
Error: Failure while executing; `/usr/local/bin/brew tap homebrew/services` exited with 1.

After setting the proxy, I fixed the issue.

➜  octopus export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890
➜  octopus brew services start jenkins-lts
==> Tapping homebrew/services
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-services'...
remote: Enumerating objects: 1174, done.
remote: Counting objects: 100% (53/53), done.
remote: Compressing objects: 100% (43/43), done.
remote: Total 1174 (delta 19), reused 13 (delta 9), pack-reused 1121
Receiving objects: 100% (1174/1174), 342.45 KiB | 2.22 MiB/s, done.
Resolving deltas: 100% (496/496), done.
Tapped 1 command (41 files, 432.8KB).
==> Successfully started `jenkins-lts` (label: homebrew.mxcl.jenkins-lts)
9

1) Tried creating a new branch and pushing. Worked for a couple of times but faced the same error again.

2)Just ran these two statements before pushing the code. All I did was to cancel the proxy.

$ git config --global --unset http.proxy
$ git config --global --unset https.proxy

3) Faced the issue again after couple of weeks. I have updated homebrew and it got fixed

1
  • This really really really helped me on Windows10 being behind a corporate proxy. I don't understand why, but doing this somehow made the credentials start working again. Thanks for the answer! Mar 26, 2020 at 8:44
7

I have a similar issue and I just found that in my case it may be the antivirus that creates an issue.

At some moment I've got the same error while trying to pull some data from github.com.

I knew that Kaspersky is intercepting the SSL connections to check for malicious content from the sites and I decided to disable it, but I found that KAV is hung and not really responding, so I just closed Kaspersky and tried to connect to github.com again and alas! I was able to connect successfully to GitHub.

So in you case it may be a similar issue.

1
  • I confirm: Kaspersky antivirus on MacOS was the culprit in my case as well!
    – Zitoun
    Jun 8, 2020 at 14:25
5

If none of the other solutions can fix your problem try edit .gitconfig file directly. In my case, I use VPN proxy for HTTP, HTTPS, SOCKs. My local proxy endpoint is 127.0.0.1:4780

.gitconfig file

[user]
    name = xxx
    email = [email protected]
[remote "origin"]
    proxy = http://127.0.0.1:4780
[http]
    proxy = http://127.0.0.1:4780
[https]
    proxy = http://127.0.0.1:4780

Be sure to fill out the [remote "origin"] section with the proxy endpoint.

3

same issue with KAV. Restart it solved the pb.

2
  • 2
    This is not an answer, consider add a comment to the question Oct 2, 2019 at 13:12
  • KAV = Kaspersky Antivirus
    – karel
    Oct 2, 2019 at 13:29
3

I also met this problem while I was using git with proxy and from my experiences there are two ways to remove this problem. I would recommend the second way.

  1. git config --global sslVerify false (equivalent with editing the ~/.gitconfig as below)
[http]
proxy = http://127.0.0.1:1234
sslVerify = false

OR

  1. replace http proxy with socks5 proxy
[http]
    proxy = socks5h://127.0.0.1:4567

NB The "h" in socks5h:// means to use remote DNS on proxy side rather than your local one, this usually expedites the communication a lot than using plain socks5:// if your local DNS is messy.

1
  • Thanks a lot for the second solution! I've using socks5 for some time and now it suddenly malfunctioned. After I changed socks5 to socks5h, it went well again! :)
    – RoyRao
    Jul 2, 2022 at 6:15
2

I would suggest updating git. If you downloaded the .pkg then be sure to uninstall it first.

1
  • Upgrading git worked for me. I just ran: brew upgrade git
    – Kevin Roth
    Feb 28, 2019 at 17:06
2

I experienced this while trying to clone from an enterprise repository, and simply restarting the terminal solved it for me.

1

The problem for me seems to have been how the user has been setup on my local machine to. Using the command
git push -u origin master
was causing the error. Removing the switch -u to have
git push origin master
solved it for me. It can be scary to imagine how user setup can result in an error related to LibreSSL.

1

for me, that's caused by the SSL certificate not enabled in the K8S ingress. hope this helps someone

1

In my case, I got the message due to token expired and after generating new token. I did as follows to update:

git remote set-url origin https://gitusername:[email protected]/gitusername/repository.git
0

Hi everyone I found the solution regarding this github issue and it works for me no longer able to use private ssh key

Try following theses steps:

1 - Use HTTPS if possible. That will avoid SSH keys entirely.
2 - Manually add the SSH key to the running SSH agent. See manually generate ssh key
3 - If the two others doesn't work, delete all your ssh keys and generate some new one thats what I did after weeks of issues.

Hope it will help you..

0

If anyone gets this issue while using the integrated terminal in Visual Studio Code then there is a good chance it's updating. Restart Visual Studio Code and you will likely see the "New Version" tab and it should all start working again.

0

I have met the same problem. Here is how I did

First, remove any local files related to homebrew, you might have a broken installation process before.

curl https://raw.githubusercontent.com/Homebrew/install/master/uninstall > uninstall_brew.rb
ruby uninstall_brew_rb

Then, export your VPN proxy in the command line if you use it.

Finally, reinstall the homebrew with

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
0

For me It was for android studio , i have excluded some folders by going to Windows Settings-> Virus & threat protection settings --> Exclusions bcoz a warning was displayed regarding antivirus during gradle build. The folders were taken from this link https://developer.android.com/studio/intro/studio-config?utm_source=android-studio#antivirus-impact
After excluding those mentioned folders i tried to perform git pull , it was not happening , then i removed from excluded folders , git pull started working .

0

enter image description here

i used mac 10.14.6 .add github.com in wifi proxy setting

0

1.open : https://www.ipaddress.com/ 2.input and get the ip : raw.githubusercontent.com 3.vi etc/hosts 4.then copy the ip like this to the hosts file: e.g: 199.232.68.133 raw.Githubusercontent.com 5.git clone again.

0

You should create a personal access token to use in place of a password with the command line or with the API.

I got the same error. And terminal says:

Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.

So, this worked for me.

0

brew install curl-openssl is deprecated. Hence it will not work. So the solution is simply to run this command in your terminal:

$ brew install curl

0

The following should do the trick:

brew update-reset 

The command will essentially fetch and reset Homebrew as well as all tap repositories. You can find more about what this command does in the actual script.

1
0

step1: Check whether the network proxy is turned on, if so, turn it off first;

step2: Enter the following command on the command line

git config --global http.sslVerifyfalse

git config --global --unset http.proxy

git config --global --unset https.proxy

git config --global http.sslBackend "openssl"

step3: After the above commands are completed, restart the command line window and happily execute your curl or other commands.

-4

I got this error "OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to gitlabee.dt.renault.com:443" while pulling the code .

Solution: Please check GitLab is available or not . Once GitLab is available try again it will work.

1
  • This is probably related with your local certificate settings, I don't think it has anything to do with gitlab
    – kigawas
    Feb 27 at 5:57

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.