##// END OF EJS Templates
sslutil: require TLS 1.1+ when supported...
sslutil: require TLS 1.1+ when supported Currently, Mercurial will use TLS 1.0 or newer when connecting to remote servers, selecting the highest TLS version supported by both peers. On older Pythons, only TLS 1.0 is available. On newer Pythons, TLS 1.1 and 1.2 should be available. Security professionals recommend avoiding TLS 1.0 if possible. PCI DSS 3.1 "strongly encourages" the use of TLS 1.2. Known attacks like BEAST and POODLE exist against TLS 1.0 (although mitigations are available and properly configured servers aren't vulnerable). I asked Eric Rescorla - Mozilla's resident crypto expert - whether Mercurial should drop support for TLS 1.0. His response was "if you can get away with it." Essentially, a number of servers on the Internet don't support TLS 1.1+. This is why web browsers continue to support TLS 1.0 despite desires from security experts. This patch changes Mercurial's default behavior on modern Python versions to require TLS 1.1+, thus avoiding known security issues with TLS 1.0 and making Mercurial more secure by default. Rather than drop TLS 1.0 support wholesale, we still allow TLS 1.0 to be used if configured. This is a compromise solution - ideally we'd disallow TLS 1.0. However, since we're not sure how many Mercurial servers don't support TLS 1.1+ and we're not sure how much user inconvenience this change will bring, I think it is prudent to ship an escape hatch that still allows usage of TLS 1.0. In the default case our users get better security. In the worst case, they are no worse off than before this patch. This patch has no effect when running on Python versions that don't support TLS 1.1+. As the added test shows, connecting to a server that doesn't support TLS 1.1+ will display a warning message with a link to our wiki, where we can guide people to configure their client to allow less secure connections.

File last commit:

r26420:2fc86d92 default
r29560:303e9300 default
Show More
test-issue1306.t
96 lines | 2.0 KiB | text/troff | Tads3Lexer
Matt Mackall
urls: bulk-change BTS urls to new location
r26420 https://bz.mercurial-scm.org/1306
Adrian Buehlmann
tests: unify test-issue*
r12195
Initialize remote repo with branches:
$ hg init remote
$ cd remote
$ echo a > a
$ hg ci -Ama
adding a
$ hg branch br
marked working directory as branch br
Matt Mackall
branch: warn on branching
r15615 (branches are permanent and global, did you want a bookmark?)
Adrian Buehlmann
tests: unify test-issue*
r12195 $ hg ci -Amb
$ echo c > c
$ hg ci -Amc
adding c
$ hg log
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 changeset: 2:ae3d9c30ec50
Adrian Buehlmann
tests: unify test-issue*
r12195 branch: br
tag: tip
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: c
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 changeset: 1:3f7f930ca414
Adrian Buehlmann
tests: unify test-issue*
r12195 branch: br
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: b
changeset: 0:cb9a9f314b8b
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: a
$ cd ..
Try cloning -r branch:
$ hg clone -rbr remote local1
adding changesets
adding manifests
adding file changes
added 3 changesets with 2 changes to 2 files
updating to branch br
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg -R local1 parents
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 changeset: 2:ae3d9c30ec50
Adrian Buehlmann
tests: unify test-issue*
r12195 branch: br
tag: tip
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: c
Try cloning -rother clone#branch:
$ hg clone -r0 remote#br local2
adding changesets
adding manifests
adding file changes
added 3 changesets with 2 changes to 2 files
updating to branch default
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg -R local2 parents
changeset: 0:cb9a9f314b8b
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: a
Try cloning -r1 clone#branch:
$ hg clone -r1 remote#br local3
adding changesets
adding manifests
adding file changes
added 3 changesets with 2 changes to 2 files
updating to branch br
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg -R local3 parents
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 changeset: 1:3f7f930ca414
Adrian Buehlmann
tests: unify test-issue*
r12195 branch: br
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: b