443 error git

I am working from home and am trying to clone a repo from Github and am getting the following error: git clone https://github.com/account/repo.git Also tried git clone git://github.com/account/r...

I am working from home and am trying to clone a repo from Github and am getting the following error:

git clone https://github.com/account/repo.git

Also tried

git clone git://github.com/account/repo.git

Error: Failed connect to github.com:443; No error while accessing https://github.com/account/repo/info/refs?service=git-upload-pac
fatal: HTTP request failed

I even tried to use SSH and this is what I get:

ssh: connect to host github.com port 22: Bad file number fatal: could
not read from remote repository.

I was just able to clone it on my laptop so I know that I have the correct permissions, I just need help trying to figure out why this is happening on my desktop and it seems that all of the other suggestions don’t seem to be working.

  • I am not using a proxy.
  • I cannot do pulls on other repos that already exist either.

EDIT
Ok I ran the command suggested, here are the results:

$ ssh -i ~/.ssh/id_rsa -vvv git@github.com
OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007
debug2: ssh_connect: needpriv 0
debug1: Connecting to github.com [204.232.175.90] port 22.
debug1: connect to address 204.232.175.90 port 22: Not owner
ssh: connect to host github.com port 22: Bad file number

Any suggestions?

I’m behind a proxy in Windows 10 (and in Windows 11), git 2.32.0.window.1. This is what worked for me.

Checking What You Have

Check your global configurations using:

$ git config --global --list

You should see the settings for user.name, user.mail etc. Having the following lines in place fixed the problem for me:

http.proxyauthmethod=basic
http.proxy=http://username:password@proxyaddress:port
https.proxy=https://username:password@proxyaddress:port

Notice these are settings for both http and https protocols. If you don’t see both, you’ll have to set them.

Setting The Proxy

Use this line of code in your console, for BOTH protocols:

$ git config --global https.proxy https://username:password@proxyaddress:port

And, if necessary:

$ git config --global http.proxy http://username:password@proxyaddress:port`

If you don’t know what the proxy and ports are, look for Internet Options (or properties) window menu in your Windows System (Control Panel).

Internet Properties (window) → Connections (tab) → LAN Settings (button) → Proxy Server (section) → Advanced (button)

And, remember to replace all values (id est: username, password, proxyaddress, and port) with the actual ones (in proxyaddress you’ll have to set up an ip number).

Keep in mind that you may need to leave some of those values empties (because they are not required by your proxy). For example, one time I had to set:

git config --global http.proxy http://:@10.1.33.244:81

As you may noticed, no user name or password were needed.

Useful Bash script

Since I have to set and unset the proxy configuration of my system on a daily basis, I’ve made this little script you main find useful: Gist

NOTE

If you need to access GitLab, you may need to follow these steps after the ones I’ve just described: GitLab authentication requires tokens

When you try to clone the repository, you’ll be prompted for your GitLab username and password. Instead of entering your regular password, you need to provide a generated token instead. The username is the same.

  • latteo

Пытаюсь пушить на сервер в локальной сети, в ответ ошибка 443

$ git push https://git@192.168.1.184/home/git/test.git
fatal: unable to access 'https://git@192.168.1.184/home/git/test.git/': Failed to connect to 192.168.1.184 port 443: Connection refused

На сервере centos. Порт в фаерволе открыт.


  • Вопрос задан

    более трёх лет назад

  • 1223 просмотра

Пригласить эксперта

Возможно проблема в команде, требуется вводить
git push [удал. сервер] [ветка]
Но перед этой командой требуется сначала получить данные
git pull origin

Cоздать для адреса сервера ссылку типа origin командой

git remote add origin https://git@192.168.1.184/home/git/test.git


  • Показать ещё
    Загружается…

09 февр. 2023, в 07:58

3500 руб./за проект

09 февр. 2023, в 07:25

50000 руб./за проект

09 февр. 2023, в 06:50

2500 руб./за проект

Минуточку внимания

git clone -v https://github.com/me/myproj
Cloning into 'myproj'...
<minutes pass>
error: Failed connect to github.com:443; Operation now in progress while accessing https://github.com/me/myproj.git/info/refs
fatal: HTTP request failed

I believe there is a problem with SSL certificates and have tried most of the solutions here: https://stackoverflow.com/questions/3777075/ssl-certificate-rejected-trying-to-access-github-over-https-behind-firewall (well, the ones that involve putting certificates in /etc/pki/tls/certs)

Is an SSL CA problem definitely the cause of this error? Any other solutions I can try? The server is RHEL 6.4.

More information

This is the result with GIT_CURL_VERBOSE=1, for a successful checkout from non-HTTPS github:

$ git clone http://github.com/stevage/tilemill-server
Cloning into 'tilemill-server'...
* Couldn't find host github.com in the .netrc file; using defaults
* About to connect() to proxy bproxy.xxx port 8080 (#0)
*   Trying 131.170.90.1... * Connected to bproxy.xxx (xxx) port 8080 (#0)
> GET http://github.com/stevage/tilemill-server/info/refs?service=git-upload-pack HTTP/1.1
User-Agent: git/1.7.11.3
Host: github.com
Accept: */*
Proxy-Connection: Keep-Alive
Pragma: no-cache

< HTTP/1.1 200 OK
< Server: GitHub.com
< Date: Mon, 09 Sep 2013 06:43:27 GMT
< Content-Type: application/x-git-upload-pack-advertisement
< Expires: Fri, 01 Jan 1980 00:00:00 GMT
< Pragma: no-cache
< Cache-Control: no-cache, max-age=0, must-revalidate
< Vary: Accept-Encoding
< Transfer-Encoding: chunked
< Proxy-Connection: Keep-Alive
< Connection: Keep-Alive
< 
* Expire cleared
* Connection #0 to host bproxy.rmit.edu.au left intact
* Couldn't find host github.com in the .netrc file; using defaults
* About to connect() to proxy bproxy.xxx port 8080 (#0)
*   Trying xxx... * connected
* Connected to bproxy.xxx (xxx) port 8080 (#0)
> POST http://github.com/stevage/tilemill-server/git-upload-pack HTTP/1.1
User-Agent: git/1.7.11.3
Host: github.com
Accept-Encoding: deflate, gzip
Proxy-Connection: Keep-Alive
Content-Type: application/x-git-upload-pack-request
Accept: application/x-git-upload-pack-result
Content-Length: 174

< HTTP/1.1 200 OK
< Server: GitHub.com
< Date: Mon, 09 Sep 2013 06:43:28 GMT
< Content-Type: application/x-git-upload-pack-result
< Expires: Fri, 01 Jan 1980 00:00:00 GMT
< Pragma: no-cache
< Cache-Control: no-cache, max-age=0, must-revalidate
< Vary: Accept-Encoding
< Transfer-Encoding: chunked
< Proxy-Connection: Keep-Alive
< Connection: Keep-Alive
< 
remote: Counting objects: 17, done.
remote: Compressing objects: 100% (13/13), done.
* Connection #0 to host bproxy.xxx left intact
remote: Total 17 (delta 3), reused 16 (delta 2)
Unpacking objects: 100% (17/17), done.
* Closing connection #0

Now, with HTTPS:

$ git clone https://github.com/stevage/tilemill-server
Cloning into 'tilemill-server'...
* Couldn't find host github.com in the .netrc file; using defaults
* About to connect() to proxy bproxy.xxx port 8080 (#0)
*   Trying xxx... * Connected to bproxy.xxx port 8080 (#0)
* Establish HTTP proxy tunnel to github.com:443
> CONNECT github.com:443 HTTP/1.1
Host: github.com:443
User-Agent: git/1.7.11.3
Proxy-Connection: Keep-Alive
Pragma: no-cache

< HTTP/1.1 200 Connection established
< 
* Proxy replied OK to CONNECT request
* Initializing NSS with certpath: sql:/etc/pki/nssdb
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* SSL connection using SSL_RSA_WITH_RC4_128_SHA
* Server certificate:
*   subject: CN=github.com,O="GitHub, Inc.",L=San Francisco,ST=California,C=US,postalCode=94107,STREET=548 4th Street,serialNumber=5157550,incorporationState=Delaware,incorporationCountry=US,businessCategory=Private Organization
*   start date: Jun 10 00:00:00 2013 GMT
*   expire date: Sep 02 12:00:00 2015 GMT
*   common name: github.com
*   issuer: CN=DigiCert High Assurance EV CA-1,OU=www.digicert.com,O=DigiCert Inc,C=US
* Connected to bproxy.xxx (xxx) port 8080 (#0)

(no more output)

I have seen other people successfully connect on HTTPS through this proxy (it’s a university-wide proxy — unlikely to be the problem).

SSL_ERROR_SYSCALL typically occurs when the server side is using an SSL certificate to authenticate. This article covers how to fix SSL_ERROR_SYSCALL error in 5 ways.

SSL_ERROR_SYSCALL Error

$ git clone https://github.com/xxx/xxx.git
fatal: unable to access ‘https://github.com/xxx/xxx.git/’: LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443

Understanding SSL_ERROR_SYSCALL Error

This error typically occurs when the TCP three-way handshake between client and server completes but then a TCP reset packet (often written as “RST”) is received by the client, terminating the connection during the SSL phase.

This error is not produced when a client receives a RST packet during the three-way handshake, or after completion of the SSL/TLS negotiation (SSL phase).

Restart the computer

As we all know, restarting solves 90% of problems, and sometimes restarting the computer can directly solve the problem.

Modify Git network configuration

We can directly modify the global Git configuration file and delete the relevant configuration of HTTP / HTTPS in the file.

$ vim ~/.gitconfig

It can also be modified using the command:

  • $ git config –global –unset http.proxy
  • $ git config –global –unset https.proxy

Check SSL Certificate with OpenSSL

Change HTTP/HTTPS encryption library

Since the problem is that the LibreSSL library reports an error, we can modify Git to use the OpenSSL library for HTTPS communication.

$ git config –global http.sslBackend “openssl”

Use HTTPS proxy for git connection

When using HTTPS to connect to GitHub for push/pull, we need to change the local git configuration and use a proxy to initiate a request to GitHub.

Execute the following command: $ git config –global -e

This will bring us into git’s configuration file editing interface (which will open with the default editor specified by git). Add the following to this file:

[http]
proxy = socks5://127.0.0.1:7891
[https]
proxy = socks5://127.0.0.1:7891

“7891” is the designated entry and exit port of our proxy software, please modify it according to the actual situation.

Use SSH for git connection

It is well known that HTTPS or SSH can be used to clone the GitHub repository, but SSH does not have the network connection problem of HTTPS, so the connection method of push/pull can be changed from HTTPS to SSH.

Requirements: we need to generate an SSH public/private key pair in advance and add the public key to our GitHub account. See Connecting to GitHub with SSH for details on this part .

Enter the corresponding directory of the warehouse and execute the following command: $ git remote set-url origin git@github.com:xxx/xxx.git

After the change is complete, we can use the following command to view the current origin address:

$ git remote -v

Understanding X509 Certificate with Openssl Command

Last week I worked behind a corporate proxy. This really was a headache because everyone knows that you have an implicit restriction when you try to surf the web. But … I didn´t know the problems I could have with GitHub, trying to sync my repos.

On my everyday tasks I use a lot PowerShell. When I need to acomplish a task, first I try to solve with the command line (if it´s possible, obviously).

So then, when I tried to clone locally a repo, using the git clone command:

  git clone https://github.com/vmsilvamolina/vmsilvamolina.github.io.git

After the execution (I had to wait a few minutes), I got the following error:

Filed to connecto to github.com port 443: Time out

Failed to connect to github.com port 443: Timed out

Solution

If you ever used Git in your life, you know there is a local configuration for parametrize the user experience. Git provides a tool called git config that lets you get and set configuration variables that control all aspects of how Git looks and operates. Among all the values, you can config the username, password, text editor and more.

For list your configuration settings, you can use the git config --list command.

If you check the result of that, you cand find the next setting:

http.proxy

That’s my boy! ;)

Well, we’ll find how we can set the values to intent to use the proxy reading the help file. How we can access it? Executing the following:

  git config --list

http.proxy

Override the HTTP proxy, normally configured using the http_proxy, https_proxy, and all_proxy environment variables (see curl(1)). In addition to the syntax understood by curl, it is possible to specify a proxy string with a user name but no password, in which case git will attempt to acquire one in the same way it does for other credentials. See gitcredentials(7) for more information. The syntax thus is [protocol://][user[:password]@]proxyhost[:port]. This can be overridden on a per-remote basis; see remote.<name>.proxy

Perfect!

For solve the “Failed to connect to github.com port 443: Timed out” message we need to run:

  git config --global http.proxy http://domain.localvsilva:[email protected]:8080

Done! You can check if the setting was applied running git config --global http.proxy

Additional info:

  • git config

Happy scripting!

Понравилась статья? Поделить с друзьями:

Читайте также:

  • 4405 код ошибки терминала
  • 4403 ошибка сбербанк терминал
  • 440102 ошибка бмв
  • 440102 ошибка bmw f10
  • 4401 ошибка сбербанк

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии