在TortoiseHG中禁用HTTPS主机身份验证以获取内部自签名证书

时间:2011-06-09 13:01:15

标签: mercurial tortoisehg tortoisehg-2.0

如何在TortoiseHG中禁用内部自签名证书的HTTPS主机身份验证。对于内部服务器,HTTPS主要用于加密。

TortoiseHG文档说可以禁用主机验证(即针对证书颁发机构链的验证)here但我似乎无法找到该选项。

在克隆远程存储库时,它应该是一个选项。我正在使用最新的TortoiseHG 2.0.5

2 个答案:

答案 0 :(得分:34)

在TortoiseHG Workbench中,在Sync选项卡中(或在Sync屏幕中),如果您选择了远程路径,您应该会看到一个带有锁定图标的按钮:

enter image description here

这将显示“安全性”窗口,您可以在其中选择选项No host validation, but still encrypted以及其他设置。当你打开它时,它会向你的mercurial.ini添加这样的内容:

[insecurehosts]
bitbucket.org = 1

这是TortoiseHg的机器级配置,但它似乎不会影响克隆窗口。

在命令行上,您可以使用--insecure来跳过验证证书:

hg clone --insecure https://hostname.org/user/repository repository-clone

这会发出一些关于不验证证书的警告,并且还会在每条消息中显示主机指纹,例如下面的示例警告(为了便于阅读而从原件格式化):

warning: bitbucket.org certificate with fingerprint 
 24:9c:45:8b:9c:aa:ba:55:4e:01:6d:58:ff:e4:28:7d:2a:14:ae:3b not verified
 (check hostfingerprints or web.cacerts config setting)

然而,更好的选择是host fingerprintshg和TortoiseHg都使用它。在TortoiseHg的安全窗口中,上面No host validationVerify with stored host fingerprint选项。 “查询”按钮检索主机证书的指纹并将其存储在mercurial.ini

[hostfingerprints]
bitbucket.org = 81:2b:08:90:dc:d3:71:ee:e0:7c:b4:75:ce:9b:6c:48:94:56:a1:fe

这应该跳过证书的实际验证,因为您声明您已经信任证书。

证书上的

This documentation也可以提供帮助。

答案 1 :(得分:1)

在Clone Repository窗口中展开选项并选中"不验证主机证书"复选框。