有没有人尝试使用openSW包中的`git'来使用bitbucket源托pipe服务(在solaris10下)?
我尝试使用git作为bitbucket文档的解释,并且 – 在Debian GNU / Linux下,它像所描述的那样完美运行,但是在Solaris 10下,我得到了Authentication Failed消息。
我甚至试图运行桁架,看到什么是可疑的,但无法findsolaris下的任何抽烟枪为什么失败。 ldd git-binary没有显示任何可疑的东西(除了libcrypt库可能是一个可疑的想法出口限制。他们运送不兼容的版本?但因为密码input到https:连接,我怀疑这只是这是一个networking级密码学问题,现在应该是普遍的)。
我现在试图在solaris 10下编译git suite,但是我确实发现了solaris 10下似乎正在使用git和bitbucket的人,并且想知道什么是错的。
注意:在最初的文章中,我没有清楚地提到GIT失败的HTTPS传输。
也就是说,当我遵循bitbucket教程时,
但在失败之后,我尝试了使用SSH。
git clone git:….成功了。
(这使用底层SSH连接。)
这意味着git命令使用HTTPS协议发送密码失败的机制。
鉴于我们可能有很多问题试图绕过SSH的防火墙,而通过HTTP或HTTPS访问几乎无处不在,我想看到“git克隆https:…”成功。
我挖了一些吸烟枪的候选人。
我认为最新的OpenSSL需要提供。
[]初始引导:GIT_SSL_NO_VERIFY
下面是关于在XP下使用git的情况,但事实certificate,这与我的问题有点间接相关。 至less使用GIT_SSL_NO_VERIFY对我来说是一个消息,使用GIT_SSL_NO_VERIFY的解决方法对我来说并不起作用,所以我可以回到其他可能的真正原因。
https://stackoverflow.com/questions/3777075/https-github-access
我遵循上面的URL中的第一个build议(使用GIT_SSL_NO_VERIFY)。 但是这并没有解决问题。 所以我的下一步是关于也许curl库版本过时?
从上面的post引用:—-开始报价
问题是您的系统上没有安装任何证书颁发机构证书。 而这些证书不能用cygwin的setup.exe来安装。
有两个解决scheme:1.忽略SSL证书validation:
$ env GIT_SSL_NO_VERIFY=true git clone https://github...
其实安装根证书。 卷毛人从你的mozilla提取证书:
cacert.pem文件是你在找什么。 这个文件包含> 250个CA证书(不知道如何信任这个数字的人工智能)。 你需要下载这个文件,把它分解成单独的证书,把它们放到/ usr / ssl / certs(你的CApath)并build立索引。 ************************* 8在solaris下:CApath:/ opt / csw / ssl / certs
这里是如何做到这一点:用cygwin setup.exe安装curl和openssl包执行:
$ cd /usr/ssl/certs $ curl http://curl.haxx.se/ca/cacert.pem | awk 'split_after==1{n++;split_after=0} /-----END CERTIFICATE-----/ {split_after=1} {print > "cert" n ".pem"}' $ c_rehash
—-报价结束
我试过GIT_SSL_NO_VERIFY = true,但还是没有骰子。 所以证书可能不是问题的直接原因。
find线索后,我发现
GIT_CURL_VERBOSE=1 export GIT_CURL_VERBOSE
产生很多产出来跟随正在发生的事情。 我在solaris和linux下附上详细的输出来比较。
[] CERT的可用性对我的问题是微不足道的。
git使用HTTPS在Linux下运行。我使用的发行版(Debian现在)安装了一些CA的公钥证书,这有助于确定bitbuckt证书的有效性等等。
在solaris10下,opencsw仓库似乎已经在/ opt / csw / ssl / certs下安装了一些证书。
所以拥有证书似乎没有问题(或者是?)。 而且由GIT_CURL_VERBOSE生成的以下日志似乎暗示了(虽然在solaris下有些粗鲁的方式)certificate了证书。
sfw和opencsw混合使用库和命令
那么为什么不使用https协议不能使用solaris版本的git呢?
看来git使用libcurl和朋友。 也许opencsw包中的libcurl没有用“with-ssl”选项编译(?)
curl-config命令(如果可用)打印版本和curl–version显示内置协议等
通过列出库来检查库版本号目录时,我注意到solaris 10存在严重混淆。有两个版本的ssl和libcurl。 一个是来自opencsw,另一个是来自某些较老的sfw(sun freeware)发行版,而且我害怕sfw是几年前的首选。 而最重要的是,curl命令本身就是来自sfw(至less在我的solaris x86(64位)化身!)
你可以看到这个组合在我的solarix 10图像上被混淆了。
SFW相关:
zephyr@zephyrus:~/repos$ ls /usr/sfw/lib/*ssl* /usr/sfw/lib/libssl.so@ /usr/sfw/lib/llib-lssl /usr/sfw/lib/libssl.so.0.9.7* /usr/sfw/lib/llib-lssl.ln /usr/sfw/lib/libssl_extra.so.0.9.7* zephyr@zephyrus:~/repos$ ls /opt/sfw/bin/*curl* /opt/sfw/bin/curl* /opt/sfw/bin/curl-config* zephyr@zephyrus:~/repos$ which curl /opt/sfw/bin/curl
CSW相关:
ls -l /opt/csw/lib/*curl* lrwxrwxrwx 1 root root 16 Mar 18 18:00 /opt/csw/lib/libcurl.so.4 -> libcurl.so.4.2.0* -rwxr-xr-x 1 root bin 689040 Feb 23 19:38 /opt/csw/lib/libcurl.so.4.2.0* zephyr@zephyrus:~/repos$ ls -l /opt/csw/lib/*ssl* lrwxrwxrwx 1 root root 29 Mar 18 17:57 /opt/csw/lib/libgnutls-openssl.so.26 -> libgnutls-openssl.so.26.16.13* -rwxr-xr-x 1 root bin 70432 Jan 18 2011 /opt/csw/lib/libgnutls-openssl.so.26.16.13* -rw-r--r-- 1 root bin 527064 Jan 24 06:08 /opt/csw/lib/libssl.a lrwxrwxrwx 1 root root 15 Mar 27 22:04 /opt/csw/lib/libssl.so -> libssl.so.0.9.8* -r-xr-xr-x 1 root bin 314056 Jan 3 2008 /opt/csw/lib/libssl.so.0.9.7* -r-xr-xr-x 1 root bin 388928 Jan 24 06:08 /opt/csw/lib/libssl.so.0.9.8* zephyr@zephyrus:~/repos$
好吧,哪些库不能使用curl的版本? 它使用CSW分布如果可用! (我早就把/ opt / csw / lib放在我的LD_LIBRARY_PATH中,这就是我想的原因。)
zephyr@zephyrus:~/repos$ ldd /opt/sfw/bin/curl libcurl.so.4 => /opt/csw/lib/libcurl.so.4 libssl.so.0.9.7 => /opt/csw/lib/libssl.so.0.9.7 libcrypto.so.0.9.7 => /opt/csw/lib/libcrypto.so.0.9.7 libsocket.so.1 => /lib/libsocket.so.1 libnsl.so.1 => /lib/libnsl.so.1 libdl.so.1 => /lib/libdl.so.1 libz.so.1 => /opt/csw/lib/libz.so.1 libz.so.1 (SUNW_1.1) => (version not found) libc.so.1 => /lib/libc.so.1 libidn.so.11 => /opt/csw/lib/libidn.so.11 libssl.so.0.9.8 => /opt/csw/lib/libssl.so.0.9.8 libcrypto.so.0.9.8 => /opt/csw/lib/libcrypto.so.0.9.8 libmp.so.2 => /lib/libmp.so.2 libmd.so.1 => /lib/libmd.so.1 libscf.so.1 => /lib/libscf.so.1 libintl.so.8 => /opt/csw/lib/libintl.so.8 libiconv.so.2 => /opt/csw/lib/libiconv.so.2 libdoor.so.1 => /lib/libdoor.so.1 libuutil.so.1 => /lib/libuutil.so.1 libgen.so.1 => /lib/libgen.so.1 libm.so.2 => /lib/libm.so.2 zephyr@zephyrus:~/repos$
[] git-remote-https命令。
进一步挖掘,我发现在/ opt / csw / libexec / git-core目录下有git-remote-https命令。 这似乎是由git克隆https:…命令使用。 (我发现这使用GIT_TRACE = 1环境variables。)
zephyr@zephyrus:~/repos$ ldd /opt/csw/libexec/git-core/git-remote-https libpthread.so.1 => /lib/libpthread.so.1 libintl.so.8 => /opt/csw/lib/libintl.so.8 libz.so.1 => /opt/csw/lib/libz.so.1 libiconv.so.2 => /opt/csw/lib/libiconv.so.2 libsocket.so.1 => /lib/libsocket.so.1 libnsl.so.1 => /lib/libnsl.so.1 libresolv.so.2 => /lib/libresolv.so.2 libcrypto.so.0.9.8 => /opt/csw/lib/libcrypto.so.0.9.8 libcurl.so.4 => /opt/csw/lib/libcurl.so.4 libexpat.so.1 => /opt/csw/lib/libexpat.so.1 libc.so.1 => /lib/libc.so.1 libmp.so.2 => /lib/libmp.so.2 libmd.so.1 => /lib/libmd.so.1 libscf.so.1 => /lib/libscf.so.1 libdl.so.1 => /lib/libdl.so.1 libidn.so.11 => /opt/csw/lib/libidn.so.11 libssl.so.0.9.8 => /opt/csw/lib/libssl.so.0.9.8 libdoor.so.1 => /lib/libdoor.so.1 libuutil.so.1 => /lib/libuutil.so.1 libgen.so.1 => /lib/libgen.so.1 libm.so.2 => /lib/libm.so.2 zephyr@zephyrus:~/repos$
所以它使用/ opt / csw / lib中的libcurl和libssl。
这个openssl可能有一个关于上面提到的点2的问题。 好吧。
[]比较版本:solaris 10 vs linux
在Solaris opencsw版本(其中git克隆https:…失败)
curl-config --version libcurl 7.16.4 curl --version curl 7.16.4 (i386-pc-solaris2.10) libcurl/7.24.0 OpenSSL/0.9.7m zlib/1.2.5 libidn/1.24 Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smtp smtps telnet tftp Features: IDN IPv6 Largefile NTLM SSL libz
在Linux(成功的地方):不知何故,我找不到curl-config
/usr/bin/curl --version curl 7.24.0 (i486-pc-linux-gnu) libcurl/7.24.0 OpenSSL/1.0.0h zlib/1.2.6 libidn/1.24 libssh2/1.2.8 librtmp/2.3 Protocols: dict file ftp ftps gopher http https imap imaps ldap pop3 pop3s rtmp rtsp scp sftp smtp smtps telnet tftp Features: Debug TrackMemory GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz zephyrus@debian-vm:~/repos$
请注意,OpenSSL在linux下是1.0h,而在solaris(!)上是0.9.7m。 这可能是问题所在。
简单的curl执行:libcurl操作失败?
我通过在solaris10(失败)和Debian GNU / Linux(成功)下运行以下命令来检查libucurl的基本操作。
curl -v https://[email protected]/myuserid/bb101rep.git
我注意到的差异是直接的。 从curl的详细输出显示在linux下的开始附近,而不是在solaris上。 所以也许sslv3握手由于某种原因不起作用。
(从Linux转储)
* SSLv3, TLS handshake, Client hello (1): * SSLv3, TLS handshake, Server hello (2): * SSLv3, TLS handshake, CERT (11): * SSLv3, TLS handshake, Server finished (14): * SSLv3, TLS handshake, Client key exchange (16): * SSLv3, TLS change cipher, Client hello (1): * SSLv3, TLS handshake, Finished (20): * SSLv3, TLS change cipher, Client hello (1): * SSLv3, TLS handshake, Finished (20):
也许curl输出中的以下几行显示了一些相关性? 请注意以下几点。
从Solaris 10日志:
* SSL: couldn't set callback! (<--- ? point 1 ?) * successfully set certificate verify locations: * CAfile: none CApath: /opt/csw/ssl/certs * WARNING: failed to configure server name indication (SNI) TLS extension (<===? point 2??) * SSL connection using AES256-SHA
也许是吸烟枪,最后。
关于上一节的第2点,我find了openssl中的一个bug的参考:
http://curl.haxx.se/mail/lib-2009-09/0294.html
但是“问题是在0.9.7f中引入的,被固定在0.9.8k”,所以在opencsw curl使用的0.9.7m中不应该是一个问题。
但谁知道如果其他bug在1.0.0 openssl潜伏。 例如下面的OpenSSL 0.9.8g的错误
http://rt.openssl.org/Ticket/Display.html?id=1629
也被称为
http://serverfault.com/questions/303090/stunnel-wont-work-with-sslv3-from-some-hosts
在这里可能很重要。
关于第1点,我find了以下post。 这也可能导致这个问题。 看来, 如果 curl是针对sfw libssl的BUILT,它会以微妙的方式(!)失败。
RE:无法设置callback! (解决)
http://curl.haxx.se/mail/archive-2010-04/0093.html
我怀疑上面的post可能是相关的,并指出罪魁祸首(这是solaris 10具体!)
无论如何,我会发布我的发现opencsw并要求build立openssl 1.0.0hbuild立和重buildcurl库反对,然后git以及。
我的结论是,如果基于1.0.0h的openssl可用,curl,libcurl和git被重新编译,那么我看到的“git clone https:…”的问题可能不会发生。
参考日志
[] curl日志:在Solaris 10下失败
curl -v https://bitbucket.org/userid/bb101repo.git/info/refs?service=git-upload-pack * About to connect() to bitbucket.org port 443 (#0) * Trying 207.223.240.182... * connected * Connected to bitbucket.org (207.223.240.182) port 443 (#0) * SSL: couldn't set callback! * successfully set certificate verify locations: * CAfile: none CApath: /opt/csw/ssl/certs * WARNING: failed to configure server name indication (SNI) TLS extension ??? key exchange is missing here in comparison to linux dump ...??? * SSL connection using AES256-SHA * Server certificate: * subject: 2.5.4.15=Private Organization; 1.3.6.1.4.1.311.60.2.1.3=US; 1.3.6.1.4.1.311.60.2.1.2=Delaware; serialNumber=3928449; streetAddress=375 Alabama St Ste 325; postalCode=94110; C=US; ST=CA; L=San Francisco; O=Atlassian, Inc.; CN=bitbucket.org * start date: 2012-01-03 00:00:00 GMT * expire date: 2014-03-12 12:00:00 GMT * subjectAltName: bitbucket.org matched * issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert High Assurance EV CA-1 * SSL certificate verify ok. > GET /userid/bb101repo.git/info/refs?service=git-upload-pack HTTP/1.1 > User-Agent: curl/7.16.4 (i386-pc-solaris2.10) libcurl/7.24.0 OpenSSL/0.9.7m zlib/1.2.5 libidn/1.24 > Host: bitbucket.org > Accept: */* > < HTTP/1.1 404 NOT FOUND < Server: nginx/1.0.6 < Date: Fri, 30 Mar 2012 18:04:59 GMT < Content-Type: text/html; charset=utf-8 < Transfer-Encoding: chunked < Connection: close < Vary: Cookie < html payload omitted. ... ... * Closing connection #0 zephyr@zephyrus:~/repos$
[] curl日志:在LINUX下成功
curl -v https://[email protected]/userid/bb101repo.git * About to connect() to bitbucket.org port 443 (#0) * Trying 207.223.240.182... * connected * Connected to bitbucket.org (207.223.240.182) port 443 (#0) * successfully set certificate verify locations: * CAfile: none CApath: /etc/ssl/certs * SSLv3, TLS handshake, Client hello (1): * SSLv3, TLS handshake, Server hello (2): * SSLv3, TLS handshake, CERT (11): * SSLv3, TLS handshake, Server finished (14): * SSLv3, TLS handshake, Client key exchange (16): * SSLv3, TLS change cipher, Client hello (1): * SSLv3, TLS handshake, Finished (20): * SSLv3, TLS change cipher, Client hello (1): * SSLv3, TLS handshake, Finished (20): * SSL connection using AES256-SHA * Server certificate: * subject: businessCategory=Private Organization; 1.3.6.1.4.1.311.60.2.1.3=US; 1.3.6.1.4.1.311.60.2.1.2=Delaware; serialNumber=3928449; street=375 Alabama St Ste 325; postalCode=94110; C=US; ST=CA; L=San Francisco; O=Atlassian, Inc.; CN=bitbucket.org * start date: 2012-01-03 00:00:00 GMT * expire date: 2014-03-12 12:00:00 GMT * subjectAltName: bitbucket.org matched * issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert High Assurance EV CA-1 * SSL certificate verify ok. * Server auth using Basic with user 'userid' > GET /userid/bb101repo.git HTTP/1.1 > Authorization: Basic emVwaHlydXMwMGpwOg== > User-Agent: curl/7.24.0 (i486-pc-linux-gnu) libcurl/7.24.0 OpenSSL/1.0.0h zlib/1.2.6 libidn/1.24 libssh2/1.2.8 librtmp/2.3 > Host: bitbucket.org > Accept: */* > * additional stuff not fine transfer.c:1037: 0 0 * HTTP 1.1 or later with persistent connection, pipelining supported < HTTP/1.1 404 NOT FOUND < Server: nginx/1.0.6 < Date: Fri, 30 Mar 2012 18:17:29 GMT < Content-Type: text/html; charset=utf-8 < Transfer-Encoding: chunked < Connection: close < Vary: Cookie < ... payload omitted ... * Closing connection #0 remote: Counting objects: 3, done. remote: Compressing objects: ... ... Unpacking objects: 100% (3/3), done. zephyrus@debian-vm:~/repos$ exit exit
脚本在2012年03月31日01时45分21秒