Table of Contents

Enabling HTTPS

The process essentially consists of two steps:

Increasing Header and Request Size Limits

Oftentimes Mercurial produces very large HTTP requests (with inordinate number of X-HgArg-... HTTP headers). This manifests in 400 Bad Request errors during hg push operations. To work around this issue, execute the following commands in an Elevated Command Prompt:

reg add HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\HTTP\Parameters /v MaxFieldLength /t reg_dword /d 16384 /f
reg add HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\HTTP\Parameters /v MaxRequestBytes /t reg_dword /d 131072 /f

And then restart HTTP.SYS:

net stop http /y
net start http
net start w3svc

See Microsoft Support Article 820129 for more information.


comments powered by Disqus

Take HgLab for a Spin

Try HgLab now. Full-featured 45-day evaluation, no credit card required.