Git 证书验证错误,但 openssl 成功

Git 证书验证错误,但 openssl 成功
$ git clone https://stash.z-hub.io/scm/zp/z-push.git
Cloning into 'z-push'...
fatal: unable to access 'https://stash.z-hub.io/scm/zp/z-push.git/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none

$ openssl s_client -connect stash.z-hub.io:443 -CAfile /etc/ssl/certs/ca-certificates.crt | grep -i verify
depth=2 C = GB, ST = Greater Manchester, L = Salford, O = COMODO CA Limited, CN = COMODO RSA Certification Authority
verify return:1
depth=1 C = GB, ST = Greater Manchester, L = Salford, O = COMODO CA Limited, CN = COMODO RSA Domain Validation Secure Server CA
verify return:1
depth=0 OU = Domain Control Validated, OU = PositiveSSL Wildcard, CN = *.z-hub.io
verify return:1
    Verify return code: 0 (ok)

CA信任有何不同?

答案1

使用 openssl 时,您使用的是特定端口 (443)。也许是 git 默认端口不受 ca 证书信任。我认为 git 默认使用端口 9418。

尝试这样做:

git clone https://stash.z-hub.io:443/scm/zp/z-push.git

相关内容