如何完全禁用Mercurial/TortoiseHg中的SSL证书检查? [英] How to entirely disable SSL certificate checks in Mercurial / TortoiseHg?
问题描述
我正在寻找一种方法,使--insecure
选项成为任何hg
\ TortoiseHg命令的默认选项.
I'm looking for a way to make --insecure
option the default one for any hg
\ TortoiseHg command.
请不要写这是一个不好的做法-我知道可能存在的风险,并认为这些风险是完全可以接受的.
Please don't write this is a bad practice - I aware about possible risks and consider they're fully acceptable.
推荐答案
将[web]
部分中的cacerts
设置为空字符串看起来是一样的.来自源:>
Setting cacerts
in the [web]
section to the empty string looks to be the same thing. From the source:
if cmdoptions.get('insecure', False):
ui.setconfig('web', 'cacerts', '!', '--insecure')
其中 Wiki确认:
有时可能很方便 禁用安全检查,例如 与主人打交道时 自签名证书.这可以是 通过禁用CA证书来完成 在命令行上进行配置:
Sometimes it may be expedient to disable security checks, for instance when dealing with hosts with self-signed certificates. This can be done by disabling the CA certificate configuration on the command line:
hg push --config web.cacerts =
hg push --config web.cacerts= https://self-signed-host/repo
因此,将cacerts=!
放在全局hgrc的[web]
部分中(在Linux-likes上为/etc/mercurial/hgrc
)将使您到达那里.
So putting cacerts=!
in the [web]
section of your global hgrc (/etc/mercurial/hgrc
on linux-likes) will get you there.
这篇关于如何完全禁用Mercurial/TortoiseHg中的SSL证书检查?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!