当我运行:'git clone ...'时Linux,我成功克隆了它。
但当我运行相同的命令时Ubuntu我收到以下错误消息:
fatal: unable to access 'https://gitserver...': gnutls_handshake() warning: The server name sent was not recognized
我也运行:
GIT_CURL_VERBOSE=1 git clone https://gitserver...
在Ubuntu机器我得到输出:
Cloning into 'aaa'...
* Couldn't find host gitserver in the .netrc file; using defaults
* Adding handle: conn: 0x24af4a0
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x24af4a0) send_pipe: 1, recv_pipe: 0
* About to connect() to gitserver port 443 (#0)
* Trying 111.222.333.444...
* Connected to gitserver (111.222.333.444) port 443 (#0)
* error reading ca cert file /etc/httpd/cert/bbb.crt (Error while reading file.)
* gnutls_handshake() warning: The server name sent was not recognized
* common name: WARNING couldn't obtain
* server certificate verification SKIPPED
在Linux我得到:
Initialized empty Git repository in /path/to/aaa/.git/
* Couldn't find host gitserver in the .netrc file; using defaults
* About to connect() to gitserver port 443 (#0)
* Trying 111.222.333.444... * Connected to gitserver (111.222.333.444) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* skipping SSL peer certificate verification
* SSL connection using TLS_DHE_RSA_WITH_AES_256_CBC_SHA
* Server certificate:
.......
现在我得到了正确的数据。
Ubuntu 和 Redhat 有什么不同?
谢谢。
答案1
我在新工作中不得不亲自处理这个问题。我使用的是 14.04 LTS,我的问题显然是我用来处理 git repo 的服务器名称实际上是 DNS 服务器中另一个服务器名称的别名。当我使用其他服务器名称时,我没有遇到任何问题,而且我不需要安装证书或在服务器端更改任何内容。
答案2
为我解决了
我发现https://stackoverflow.com/questions/7766961/git-trouble-via-https-routinesssl23-get-server-hello对我有用的解决方案:
我添加了行
BrowserMatch "git" nokeepalive ssl-unclean-shutdown
到apache的配置文件。