连接到 VPN 时无法克隆存储库。 SSL:证书使用者名称与目标主机名不匹配 'github.com'

Unable to clone repository while connected to VPN. SSL: certificate subject name does not match target host name 'github.com'

我正在尝试在通过 ssh 连接的远程系统上克隆一个 git 存储库。我需要连接到 VPN 才能通过 ssh 连接到我组织的本地计算机。

我正在尝试克隆 this git repository 但出现 SSL 错误,

fatal: unable to access 'https://github.com/chiphuyen/stanford-tensorflow-tutorials.git/': SSL: certificate subject name (*.<organisation-name>.com) does not match target host name 'github.com'

如果我无法修改系统配置,如何将此存储库克隆到给定的远程桌面?

基本信息:

你可以disable certificate verification;

git -c http.sslVerify=False clone \
https://github.com/chiphuyen/stanford-tensorflow-tutorials.git

注意:

Git will let you disable SSL certificate verification on a global, per host or per command invocation basis. But before you do any of this, you have to understand that this is a really bad thing: it opens you up to man-in-the-middle attacks and you should really consider all data (including passwords) sent this way to be compromised.

(实际上,下载一些 tensorflow 示例 可能 没问题。)

因此,最好按上面所示的方式在每个命令的基础上执行此操作。您应该从不全局禁用证书验证;

a grue will absolutely eat you.

猜测,这很可能与有问题的系统配置或您的 VPN 连接无关。我怀疑您组织的防火墙设置为通过 MITM 系统地拦截 SSL 流量以进行深度数据包检查。