**What is Mercurial TLS Configuration?**
Mercurial uses Transport Layer Security to encrypt connections between clients and servers. It protects repository data during clone, pull, and push operations. Proper TLS configuration ensures strong encryption, verified certificates, and defense against protocol downgrade attacks.
Core TLS Settings in Mercurial
You control TLS with the hgrc file and system-wide OpenSSL or GnuTLS settings. In [web] and [hostfingerprint] sections, you pin known server fingerprints. This prevents man-in-the-middle attacks. Use certificatefile to point to trusted CA bundles. Avoid expired or self-signed certs unless policy dictates and you control both ends.
Cipher Suites
Set only modern cipher suites: TLS 1.2 and TLS 1.3 with AES-GCM or ChaCha20-Poly1305. Disable weak algorithms like RC4, 3DES, and MD5. In OpenSSL config, define CipherString tightly—Mercurial inherits that setting.
Protocol Versions
Force TLS 1.2 minimum. Many clients already speak TLS 1.3, which is faster and safer. Block SSLv3 and TLS 1.0/1.1 to prevent known attacks like POODLE and BEAST.