0

I've been trying to solve this problem for days and have been unsuccessful.

Here's the setup: everything is running behind a corporate firewall. I have a dockerfile with an ubuntu image. Everything is working fine behind the firewall, I've setup the certificate and the proxy setting. The only thing not working is git. I cannot clone anything.

I have setup the certificate and the proxy like this:

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

This is what I get when I run it:

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
abc
  • 1
  • 2

2 Answers2

1

error: RPC failed; curl 56 GnuTLS recv error (-110): The TLS connection was non-prope

The error is not from the proxy or due to proxy, but the error is from git either it is not installed properly or you missed something during installation.

possible solution

Install OpenSSL if not installed

RUN sudo apt install openssl

Try with ssh

RUN git clone git@github.com/asd/asd.git

You can check further possible reason here.

Or you can try

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
Adiii
  • 54,482
  • 7
  • 145
  • 148
0

The issue was not the proxy settings for git. Git does not work properly in ubuntu LTS because of GnuTLS. It only fails when using Ubuntu behind a proxy under certain scenarios. The only solution is to rebuild git from source with OpenSSL instead of GnulTLS.

This seems like a very complicated way of solving the problem but I tried a lot of different solutions before this that did not work. Here is a summary of the stuff I tried:

  • Linux environmental variables
  • Certificates + proxy settings for git and Linux
  • Docker settings, environment and state conservation
  • Reinstall Git and GnuTLS
  • Updating ubuntu to ubuntu 18
  • Clone using Wget, curl Clone outside the container and copy
abc
  • 1
  • 2