[git] SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443

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.

This question is related to git npm openssl homebrew

The answer is

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.

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.

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.

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.

I just turned off VPN and it solved the issue.

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.

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

Issue solved by setting this env variable:


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

same issue with KAV. Restart it solved the pb.

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

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

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

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.

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.

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..

Questions with git tag:

Does the target directory for a git clone have to match the repo name? Git fatal: protocol 'https' is not supported Git is not working after macOS Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools) git clone: Authentication failed for <URL> destination path already exists and is not an empty directory SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443 GitLab remote: HTTP Basic: Access denied and fatal Authentication How can I switch to another branch in git? VS 2017 Git Local Commit DB.lock error on every commit How to remove an unpushed outgoing commit in Visual Studio? How to know the git username and email saved during configuration? How to add a new project to Github using VS Code git clone error: RPC failed; curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054 fatal: ambiguous argument 'origin': unknown revision or path not in the working tree HTTP Basic: Access denied fatal: Authentication failed npm notice created a lockfile as package-lock.json. You should commit this file Do I commit the package-lock.json file created by npm 5? Abort a Git Merge key_load_public: invalid format git - remote add origin vs remote set-url origin Visual Studio 2017 - Git failed with a fatal error Get git branch name in Jenkins Pipeline/Jenkinsfile Changing the git user inside Visual Studio Code How to compare different branches in Visual Studio Code Git checkout - switching back to HEAD Clear git local cache Deleting a local branch with Git Rebuild Docker container on file changes Cloning specific branch How to add chmod permissions to file in Git? Git copy changes from one branch to another Git merge with force overwrite Project vs Repository in GitHub How to add a file to the last commit in git? Getting permission denied (public key) on gitlab Delete commit on gitlab gpg failed to sign the data fatal: failed to write commit object [Git 2.10.0] Remove a modified file from pull request Updates were rejected because the tip of your current branch is behind its remote counterpart Can't push to the heroku How to discard local changes and pull latest from GitHub repository In Visual Studio Code How do I merge between two local branches? error: RPC failed; curl transfer closed with outstanding read data remaining Change drive in git bash for windows Checkout Jenkins Pipeline Git SCM with credentials? How to fix git error: RPC failed; curl 56 GnuTLS Trying to pull files from my Github repository: "refusing to merge unrelated histories" Visual Studio Code how to resolve merge conflicts with git? merge one local branch into another local branch Can't push to remote branch, cannot be resolved to branch

Questions with npm tag:

What does 'x packages are looking for funding' mean when running `npm install`? error: This is probably not a problem with npm. There is likely additional logging output above Module not found: Error: Can't resolve 'core-js/es6' Browserslist: caniuse-lite is outdated. Please run next command `npm update caniuse-lite browserslist` ERROR in The Angular Compiler requires TypeScript >=3.1.1 and <3.2.0 but 3.2.1 was found instead DeprecationWarning: Buffer() is deprecated due to security and usability issues when I move my script to another server Please run `npm cache clean` What exactly is the 'react-scripts start' command? On npm install: Unhandled rejection Error: EACCES: permission denied Difference between npx and npm? Local package.json exists, but node_modules missing npx command not found What could cause an error related to npm not being able to find a file? No contents in my node_modules subfolder. Why is that? SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443 Error: EACCES: permission denied, access '/usr/local/lib/node_modules' ERROR in Cannot find module 'node-sass' NPM Install Error:Unexpected end of JSON input while parsing near '...nt-webpack-plugin":"0' When I run `npm install`, it returns with `ERR! code EINTEGRITY` (npm 5.3.0) E: Unable to locate package npm Is there a way to force npm to generate package-lock.json? ERROR in ./node_modules/css-loader? Downgrade npm to an older version Node - was compiled against a different Node.js version using NODE_MODULE_VERSION 51 npm WARN ... requires a peer of ... but none is installed. You must install peer dependencies yourself Error: EPERM: operation not permitted, unlink 'D:\Sources\**\node_modules\fsevents\node_modules\abbrev\package.json' npm install Error: rollbackFailedOptional webpack: Module not found: Error: Can't resolve (with relative path) npm ERR! code UNABLE_TO_GET_ISSUER_CERT_LOCALLY npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Nuwanst\package.json' Laravel 5.4 ‘cross-env’ Is Not Recognized as an Internal or External Command Why does "npm install" rewrite package-lock.json? The term 'ng' is not recognized as the name of a cmdlet Npm Error - No matching version found for What is the role of the package-lock.json? Do I commit the package-lock.json file created by npm 5? What is the difference between npm install and npm run build? How to resolve Nodejs: Error: ENOENT: no such file or directory Node update a specific package Cannot uninstall angular-cli Field 'browser' doesn't contain a valid alias configuration How can I add a .npmrc file? How to solve npm error "npm ERR! code ELIFECYCLE" You seem to not be depending on "@angular/core". This is an error Why is "npm install" really slow? Checking version of angular-cli that's installed? How to specify a port to run a create-react-app based project? Maximum call stack size exceeded on npm install npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected] How to clear cache in Yarn? How to update TypeScript to latest version with npm?

Questions with openssl tag:

dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib How to install OpenSSL in windows 10? SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443 How to fix: fatal error: openssl/opensslv.h: No such file or directory in RedHat 7 Homebrew refusing to link OpenSSL Solving sslv3 alert handshake failure when trying to use a client certificate How to install latest version of openssl Mac OS X El Capitan How to resolve the "EVP_DecryptFInal_ex: bad decrypt" during file decryption SSL error SSL3_GET_SERVER_CERTIFICATE:certificate verify failed Can't get private key with openssl (no start line:pem_lib.c:703:Expecting: ANY PRIVATE KEY) Authentication failed because remote party has closed the transport stream TLS 1.2 not working in cURL List supported SSL/TLS versions for a specific OpenSSL build Creating self signed certificate for domain and subdomains - NET::ERR_CERT_COMMON_NAME_INVALID SSL: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch Verify a certificate chain using openssl verify curl: (60) SSL certificate problem: unable to get local issuer certificate OpenSSL Command to check if a server is presenting a certificate SSL Error: unable to get local issuer certificate How to upgrade OpenSSL in CentOS 6.5 / Linux / Unix from source? Enter export password to generate a P12 certificate How can I generate a self-signed certificate with SubjectAltName using OpenSSL? Correct location of openssl.cnf file create a trusted self-signed SSL cert for localhost (for use with Express/Node) How to determine SSL cert expiration date from a PEM encoded certificate? How do you sign a Certificate Signing Request with your Certification Authority? Creating a .p12 file OpenSSL: PEM routines:PEM_read_bio:no start line:pem_lib.c:703:Expecting: TRUSTED CERTIFICATE How does an SSL certificate chain bundle work? Differences between "BEGIN RSA PRIVATE KEY" and "BEGIN PRIVATE KEY" How to convert .pem into .key? Unable to load Private Key. (PEM routines:PEM_read_bio:no start line:pem_lib.c:648:Expecting: ANY PRIVATE KEY) How to convert a private key to an RSA private key? openssl s_client -cert: Proving a client certificate was sent to the server How to save public key from a certificate in .pem format Can't open config file: /usr/local/ssl/openssl.cnf on Windows unable to set private key file: './cert.pem' type PEM CMake not able to find OpenSSL library How to add certificate chain to keystore? How to use OpenSSL to encrypt/decrypt files? Converting pfx to pem using openssl Update OpenSSL on OS X with Homebrew Unable to establish SSL connection, how do I fix my SSL cert? Converting PKCS#12 certificate into PEM using OpenSSL Change keystore password from no password to a non blank password Unable to load config info from /usr/local/ssl/openssl.cnf on Windows You must enable the openssl extension to download files via https Python Requests requests.exceptions.SSLError: [Errno 8] _ssl.c:504: EOF occurred in violation of protocol OPENSSL file_get_contents(): Failed to enable crypto How to fix "unable to write 'random state' " in openssl

Questions with homebrew tag:

dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.62.dylib error running php after installing node with brew on Mac How can I install a previous version of Python 3 in macOS using homebrew? SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443 pip3: command not found env: node: No such file or directory in mac Stuck at ".android/repositories.cfg could not be loaded." Brew install docker does not include docker engine? What do raw.githubusercontent.com URLs represent? Homebrew refusing to link OpenSSL How to update Ruby with Homebrew? How to install latest version of openssl Mac OS X El Capitan Can I use Homebrew on Ubuntu? Installing cmake with home-brew How can I upgrade NumPy? No such keg: /usr/local/Cellar/git What is the suggested way to install brew, node.js, io.js, nvm, npm on OS X? How to Install Sublime Text 3 using Homebrew Homebrew: Could not symlink, /usr/local/bin is not writable How to avoid "cannot load such file -- utils/popen" from homebrew on OSX nvm keeps "forgetting" node in new terminal session Broken references in Virtualenvs Installing Google Protocol Buffers on mac How to tell if homebrew is installed on Mac OS X What is the difference/usage of homebrew, macports or other package installation tools? Installing R with Homebrew Installing Homebrew on OS X Where do I find the bashrc file on Mac? How to link home brew python version and set it as default ImportError: No module named PyQt4 How to fix homebrew permissions? How do you update Xcode on OSX to the latest version? Update OpenSSL on OS X with Homebrew Python pip install module is not found. How to link python to pip location? Can't connect to local MySQL server through socket homebrew How can I see the current value of my $PATH variable on OS X? Brew doctor says: "Warning: /usr/local/include isn't writable." Error Installing Homebrew - Brew Command Not Found How can I brew link a specific version? Postgres could not connect to server Error: The 'brew link' step did not complete successfully PostgreSQL error 'Could not connect to server: No such file or directory' What is the best/safest way to reinstall Homebrew? How to modify PATH for Homebrew? After MySQL install via Brew, I get the error - The server quit without updating PID file How do I find a list of Homebrew's installable packages? How can I start PostgreSQL server on Mac OS X? For homebrew mysql installs, where's my.cnf? Uninstall / remove a Homebrew package including all its dependencies How do I install imagemagick with homebrew?