How to fix use the cURL to connect to GitHub with a 443 HTTPS error All In One

发布时间 2023-04-18 12:00:30作者: xgqfrms

How to fix use the cURL to connect to GitHub with a 443 HTTPS error All In One

# nvm
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash

https://github.com/nvm-sh/nvm#installing-and-updating

errors

curl: (7) Failed to connect to raw.githubusercontent.com port 443: 拒绝连接

pi@raspberrypi:~ $ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (7) Failed to connect to raw.githubusercontent.com port 443: 拒绝连接

image

solution

  1. ping & get the IP address
$ pi@raspberrypi:~ $ ping github.com
PING github.com (20.205.243.166) 56(84) bytes of data.
64 bytes from 20.205.243.166 (20.205.243.166): icmp_seq=1 ttl=113 time=175 ms
64 bytes from 20.205.243.166 (20.205.243.166): icmp_seq=2 ttl=113 time=92.9 ms
^C
--- github.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 92.860/133.709/174.558/40.849 ms


image

  1. 配置 hosts 文件
$ cat /etc/hosts

$ sudo vim /etc/hosts

# add the belows one line code
# 20.205.243.166 github.com

image

(? 反爬虫测试!打击盗版⚠️)如果你看到这个信息, 说明这是一篇剽窃的文章,请访问 https://www.cnblogs.com/xgqfrms/ 查看原创文章!

refs



©xgqfrms 2012-2021

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 ?️,侵权必究⚠️!