How to entirely disable SSL certificate checks in Mercurial / TortoiseHg?

前端 未结 4 875
无人及你
无人及你 2020-12-13 09:14

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 practi

4条回答
  •  时光取名叫无心
    2020-12-13 09:16

    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')
    

    which the wiki confirms:

    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://self-signed-host/repo

    So putting cacerts=! in the [web] section of your global hgrc (/etc/mercurial/hgrc on linux-likes) will get you there.

提交回复
热议问题