Mercurial > hg-stable
annotate tests/test-branch-tag-confict.t @ 29560:303e9300772a
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.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Wed, 13 Jul 2016 21:35:54 -0700 |
parents | f2719b387380 |
children |
rev | line source |
---|---|
13750
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
1 Initial setup. |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
2 |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
3 $ hg init repo |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
4 $ cd repo |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
5 $ touch thefile |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
6 $ hg ci -A -m 'Initial commit.' |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
7 adding thefile |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
8 |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
9 Create a tag. |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
10 |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
11 $ hg tag branchortag |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
12 |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
13 Create a branch with the same name as the tag. |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
14 |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
15 $ hg branch branchortag |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
16 marked working directory as branch branchortag |
15615 | 17 (branches are permanent and global, did you want a bookmark?) |
13750
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
18 $ hg ci -m 'Create a branch with the same name as a tag.' |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
19 |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
20 This is what we have: |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
21 |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
22 $ hg log |
14162
301725c3df9a
localrepo: reuse parent manifest in commitctx if no files have changed
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
13750
diff
changeset
|
23 changeset: 2:10519b3f489a |
13750
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
24 branch: branchortag |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
25 tag: tip |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
26 user: test |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
27 date: Thu Jan 01 00:00:00 1970 +0000 |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
28 summary: Create a branch with the same name as a tag. |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
29 |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
30 changeset: 1:2635c45ca99b |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
31 user: test |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
32 date: Thu Jan 01 00:00:00 1970 +0000 |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
33 summary: Added tag branchortag for changeset f57387372b5d |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
34 |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
35 changeset: 0:f57387372b5d |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
36 tag: branchortag |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
37 user: test |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
38 date: Thu Jan 01 00:00:00 1970 +0000 |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
39 summary: Initial commit. |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
40 |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
41 Update to the tag: |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
42 |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
43 $ hg up 'tag(branchortag)' |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
44 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
45 $ hg parents |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
46 changeset: 0:f57387372b5d |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
47 tag: branchortag |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
48 user: test |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
49 date: Thu Jan 01 00:00:00 1970 +0000 |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
50 summary: Initial commit. |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
51 |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
52 Updating to the branch: |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
53 |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
54 $ hg up 'branch(branchortag)' |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
55 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
56 $ hg parents |
14162
301725c3df9a
localrepo: reuse parent manifest in commitctx if no files have changed
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
13750
diff
changeset
|
57 changeset: 2:10519b3f489a |
13750
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
58 branch: branchortag |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
59 tag: tip |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
60 user: test |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
61 date: Thu Jan 01 00:00:00 1970 +0000 |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
62 summary: Create a branch with the same name as a tag. |
7eb82f88e157
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
63 |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
15615
diff
changeset
|
64 |
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
15615
diff
changeset
|
65 $ cd .. |