Comments
Patch
@@ -494,16 +494,21 @@ def _defaultcacerts(ui):
# files. Also consider exporting the keychain certs to a file during
# Mercurial install.
if not _canloaddefaultcerts:
ui.warn(_('(unable to load CA certificates; see '
'https://mercurial-scm.org/wiki/SecureConnections for '
'how to configure Mercurial to avoid this message)\n'))
return None
+ # / is writable on Windows. Out of an abundance of caution make sure
+ # we're not on Windows because paths from _systemcacerts could be installed
+ # by non-admin users.
+ assert os.name != 'nt'
+
# Try to find CA certificates in well-known locations. We print a warning
# when using a found file because we don't want too much silent magic
# for security settings. The expectation is that proper Mercurial
# installs will have the CA certs path defined at install time and the
# installer/packager will make an appropriate decision on the user's
# behalf. We only get here and perform this setting as a feature of
# last resort.
if not _canloaddefaultcerts: