如何完全禁用Mercurial/TortoiseHg中的SSL证书检查? [英] How to entirely disable SSL certificate checks in Mercurial / TortoiseHg?

查看:137
本文介绍了如何完全禁用Mercurial/TortoiseHg中的SSL证书检查?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种方法,使--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 = https://自签名主机/存储库

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆