@@ -63,16 +63,17 @@ from . import (
pvec,
repair,
revlog,
revset,
scmutil,
setdiscovery,
simplemerge,
sshserver,
+ sslutil,
streamclone,
templatekw,
templater,
treediscovery,
ui as uimod,
util,
)
@@ -2698,16 +2699,35 @@ def debuginstall(ui, **opts):
# Python
fm.write('pythonexe', _("checking Python executable (%s)\n"),
sys.executable)
fm.write('pythonver', _("checking Python version (%s)\n"),
("%s.%s.%s" % sys.version_info[:3]))
fm.write('pythonlib', _("checking Python lib (%s)...\n"),
os.path.dirname(os.__file__))
+ security = set(sslutil.supportedprotocols)
+ if sslutil.hassni:
+ security.add('sni')
+
+ fm.write('pythonsecurity', _("checking Python security support (%s)\n"),
+ fm.formatlist(sorted(security), name='protocol',
+ fmt='%s', sep=','))
+
+ # These are warnings, not errors. So don't increment problem count. This
+ # may change in the future.
+ if 'tls1.2' not in security:
+ fm.plain(_(' TLS 1.2 not supported by Python install; '
+ 'network connections lack modern security'))
+ if 'sni' not in security:
+ fm.plain(_(' SNI not supported by Python install; may have '
+ 'connectivity issues with some servers'))
+
+ # TODO print CA cert info
+
# hg version
hgver = util.version()
fm.write('hgver', _("checking Mercurial version (%s)\n"),
hgver.split('+')[0])
fm.write('hgverextra', _("checking Mercurial custom build (%s)\n"),
'+'.join(hgver.split('+')[1:]))
# compiled modules
@@ -1,14 +1,17 @@
hg debuginstall
$ hg debuginstall
checking encoding (ascii)...
checking Python executable (*) (glob)
checking Python version (2.*) (glob)
checking Python lib (*lib*)... (glob)
+ checking Python security support (*) (glob)
+ TLS 1.2 not supported by Python install; network connections lack modern security (?)
+ SNI not supported by Python install; may have connectivity issues with some servers (?)
checking Mercurial version (*) (glob)
checking Mercurial custom build (*) (glob)
checking module policy (*) (glob)
checking installed modules (*mercurial)... (glob)
checking templates (*mercurial?templates)... (glob)
checking default template (*mercurial?templates?map-cmdline.default) (glob)
checking commit editor... (* -c "import sys; sys.exit(0)") (glob)
checking username (test)
@@ -28,30 +31,34 @@ hg debuginstall JSON
"extensionserror": null,
"hgmodulepolicy": "*", (glob)
"hgmodules": "*mercurial", (glob)
"hgver": "*", (glob)
"hgverextra": "*", (glob)
"problems": 0,
"pythonexe": "*", (glob)
"pythonlib": "*", (glob)
+ "pythonsecurity": [*], (glob)
"pythonver": "*.*.*", (glob)
"templatedirs": "*mercurial?templates", (glob)
"username": "test",
"usernameerror": null,
"vinotfound": false
}
]
hg debuginstall with no username
$ HGUSER= hg debuginstall
checking encoding (ascii)...
checking Python executable (*) (glob)
checking Python version (2.*) (glob)
checking Python lib (*lib*)... (glob)
+ checking Python security support (*) (glob)
+ TLS 1.2 not supported by Python install; network connections lack modern security (?)
+ SNI not supported by Python install; may have connectivity issues with some servers (?)
checking Mercurial version (*) (glob)
checking Mercurial custom build (*) (glob)
checking module policy (*) (glob)
checking installed modules (*mercurial)... (glob)
checking templates (*mercurial?templates)... (glob)
checking default template (*mercurial?templates?map-cmdline.default) (glob)
checking commit editor... (* -c "import sys; sys.exit(0)") (glob)
checking username...
@@ -66,16 +73,19 @@ path variables are expanded (~ is the sa
#if execbit
$ chmod 755 tools/testeditor.exe
#endif
$ hg debuginstall --config ui.editor=~/tools/testeditor.exe
checking encoding (ascii)...
checking Python executable (*) (glob)
checking Python version (*) (glob)
checking Python lib (*lib*)... (glob)
+ checking Python security support (*) (glob)
+ TLS 1.2 not supported by Python install; network connections lack modern security (?)
+ SNI not supported by Python install; may have connectivity issues with some servers (?)
checking Mercurial version (*) (glob)
checking Mercurial custom build (*) (glob)
checking module policy (*) (glob)
checking installed modules (*mercurial)... (glob)
checking templates (*mercurial?templates)... (glob)
checking default template (*mercurial?templates?map-cmdline.default) (glob)
checking commit editor... (* -c "import sys; sys.exit(0)") (glob)
checking username (test)