几天来我一直在努力解决这个问题,但一直没有成功。
这里是设置:一切都在公司防火墙后面运行。我有一个带有ubuntu映像的dockerfile。防火墙后一切正常,我已经设置了证书和代理设置。唯一不起作用的是git。我无法克隆任何东西。
我已经这样设置了证书和代理:
RUN git config --global http.proxy http://165.225.80.41:80 RUN git config --global http.sslCAPath /usr/local/share/ca-certificates/abcd/abcd.crt
RUN git config --global http.sslCAInfo /usr/local/share/ca-certificates/abcd/abcd.crt
RUN git clone https://github.com/asd/asd.git
这是我运行它时得到的:
Step 39/156 : RUN git clone https://github.com/asd/asd.git
---> Running in e20ef1c7ac5d
Cloning into 'asd'...
error: RPC failed; curl 56 GnuTLS recv error (-110): The TLS connection was non-properly terminated
答案 0 :(得分:0)
错误:RPC失败; curl 56 GnuTLS接收错误(-110):TLS 连接不正确
该错误不是来自代理或由于代理引起的,但错误是由于git导致的,要么安装不正确,要么在安装过程中错过了某些东西。
可能的解决方案
如果未安装OpenSSL,则安装
RUN sudo apt install openssl
尝试ssh
RUN git clone git@github.com/asd/asd.git
您可以检查其他可能的原因here。
或者您可以尝试
RUN git config --global http.proxy http://165.225.80.41:80 && \
git config --global http.sslCAPath /usr/local/share/ca-certificates/abcd/abcd.crt && \
git config --global http.sslCAInfo /usr/local/share/ca-certificates/abcd/abcd.crt && \
git clone https://github.com/asd/asd.git
答案 1 :(得分:0)
问题不是git的代理设置。由于GnuTLS,Git在ubuntu LTS中无法正常工作。仅在某些情况下在代理后使用Ubuntu时失败。唯一的解决方案是使用OpenSSL而非GnulTLS从源代码重建git。
这似乎是解决问题的非常复杂的方法,但是在此之前,我尝试了许多不同的解决方案,但均未奏效。这是我尝试过的东西的摘要: