How to see if git binary is using openssl or gnutls?

我的未来我决定 提交于 2019-12-01 22:39:08

问题


I'm trying to debug a strange issue with git clone, https protocol, of one specific repo using Ubuntu with a corporate proxy. The same thing works in CentOS, Fedora distros but not on Ubuntu or Debian in our environment.

Apparently in Ubuntu packages git is using gnutls, but on other platform openssl. However building from sources, even on Ubuntu, uses openssl according to this.

Is there a way for me to check from a given git installation which one the binary is using? Some output that would tell me?

These questions are related, but both talk about changing it either runtime or build time - at this point I would just need the info about which one it is.


回答1:


$ cd /usr/lib/git-core
$ ./git --version
git version 1.9.1
$ ldd git-http-fetch | grep libcurl
    libcurl-gnutls.so.4 => /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4 (0x00007f8d5dcdf000)

$ cd /usr/libexec/git-core
$ ./git --version
git version 2.8.1
$ ldd git-http-fetch | grep libcurl
    libcurl-gnutls.so.4 => /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4 (0x00007f6bd1e42000)

So apparently both my operating-system supplied version and my self-compiled version are against gnutls.

Edit: this is what openssl output looks like when the same command is run, there is no libcurl-gnutls, but

libcurl.so.4 => /usr/lib/x86_64-linux-gnu/libcurl.so.4 (0x00007fe96267e000)

Edit2: looking at this answer, seems git at runtime is just using whatever libcurl the system is set up to use, so my question was a bit misleading. Anyway, this answer is correct in the sense that it will tell which one is being used.



来源:https://stackoverflow.com/questions/36939033/how-to-see-if-git-binary-is-using-openssl-or-gnutls

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!