其他分享
首页 > 其他分享> > LibreSSL SSL_read: SSL_ERROR_SYSCALL git 代理引发失败

LibreSSL SSL_read: SSL_ERROR_SYSCALL git 代理引发失败

作者:互联网

背景

鼓捣了一套新的方案,在命令行里想出国,写到了脚本函数里,这之后就遇到 git pull | push 都报错(LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 60),于是开始排查问题

发现问题

git push
fatal: unable to access 'https://github.com/XXX/XXX.git/': LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to 127.0.0.1:8001

git pull
fatal: unable to access 'https://github.com/XXX/XXX.git/': LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to 127.0.0.1:8001

然后直接 github 也不行:

查看配置

因为不是新方案嘛,加了新的环境变量代理,就走不通,我的配置如下:

export http_proxy=http://127.0.0.1:8001;
export https_proxy=https://127.0.0.1:8001;

发现问题

根据报错情况来看,是 8001 端口不通,但是梯子代理明明是 8001,再仔细一看,原来是粗心了,本地只代理了http=> 8001 ,没有 https 代理,我的配置应该是将 https 的请求也通过 http://127.0.0.1:8001来代理出去,至此修改环境变量配置:

export https_proxy=http://127.0.0.1:8001;

解决问题且验证

总结


# 终端代理配置 开启后每次打开终端都生效
function proxy {
        if [[ $1 = "on" ]]; then
                export http_proxy=http://127.0.0.1:8001
                        export https_proxy=http://127.0.0.1:8001
                        # 验证当前 ip 信息
                        curl ifconfig.co
                        echo -e "已开启代理" http_proxy=$http_proxy https_proxy=$https_proxy

        elif [[ $1 = "off" ]]; then
                        unset http_proxy
                        unset https_proxy
                        git config --global --unset http.proxy
                        git config --global --unset https.proxy
                        echo -e "已关闭代理"
        elif [[ $1 = "git" ]]; then
                        git config --global http.proxy 'https://127.0.0.1:8001'
                        git config --global https.proxy 'https://127.0.0.1:8001'
                        echo -e "已经开启 git"
        elif [[ $1 = "gitsock" ]]; then
                        git config --global http.proxy 'socks://localhost:1080'
                        git config --global https.proxy 'socks://localhost:1080'
                        echo -e "已经开启 gitsock!"
        else
                echo -n "Usage: proxy [on|off|git] "
        fi
}

标签:0.1,git,http,SYSCALL,SSL,proxy,https,8001
来源: https://www.cnblogs.com/darrenzzy/p/14903741.html