sapling/mercurial
Gregory Szorc 596098a717 sslutil: check for missing certificate and key files (issue5598)
Currently, sslutil._hostsettings() performs validation that web.cacerts
exists. However, client certificates are passed in to the function
and not all callers may validate them. This includes
httpconnection.readauthforuri(), which loads the [auth] section.

If a missing file is specified, the ssl module will raise a generic
IOException. And, it doesn't even give us the courtesy of telling
us which file is missing! Mercurial then prints a generic
"abort: No such file or directory" (or similar) error, leaving users
to scratch their head as to what file is missing.

This commit introduces explicit validation of all paths passed as
arguments to wrapsocket() and wrapserversocket(). Any missing file
is alerted about explicitly.

We should probably catch missing files earlier - as part of loading
the [auth] section. However, I think the sslutil functions should
check for file presence regardless of what callers do because that's
the only way to be sure that missing files are always detected.
2017-07-10 21:09:46 -07:00
..
cext revlog: address review feedback for deltachain C implementation 2017-07-01 19:35:17 -07:00
cffi cffi: remove superfluous "if True" blocks 2017-05-02 21:45:10 +09:00
default.d mergetools.rc: find OSX FileMerge in the new location inside Xcode 4.3 2015-10-16 11:37:34 +02:00
help merge with stable 2017-07-05 11:55:26 -04:00
hgweb hgweb: use ui._unset to prevent a warning in configitems 2017-07-03 13:04:35 +02:00
httpclient httpclient: update to 54868ef054d2 of httpplus 2016-06-27 11:53:50 -04:00
pure lazymanifest: write a more efficient, pypy friendly version of lazymanifest 2016-09-12 13:37:14 +02:00
templates show: implement "stack" view 2017-07-01 22:38:42 -07:00
__init__.py loader: pywatchman appears to already be py3 compatible 2017-05-28 15:45:47 -04:00
ancestor.py py3: add __bool__ to every class defining __nonzero__ 2017-03-13 12:40:14 -07:00
archival.py archival: flag missing files as a dirty wdir() in the metadata file (BC) 2017-07-09 02:46:03 -04:00
bdiff.c bdiff: split bdiff into cpy-aware and cpy-agnostic part 2016-07-13 10:46:26 +02:00
bdiff.h bdiff: split bdiff into cpy-aware and cpy-agnostic part 2016-07-13 10:46:26 +02:00
bitmanipulation.h bitmanipulation: add missing include of string.h 2017-06-02 10:32:39 -07:00
bookmarks.py obsutil: move 'foreground' to the new modules 2017-06-27 01:40:34 +02:00
branchmap.py rbc: fix superfluous rebuilding from scratch - don't abuse self._rbcnamescount 2016-07-18 22:25:09 +02:00
bundle2.py obsolete: reports the number of local changeset obsoleted when unbundling 2017-06-28 03:54:19 +02:00
bundlerepo.py configitems: register the 'bundle.mainreporoot' config 2017-06-30 03:31:26 +02:00
byterange.py pycompat: switch to util.urlreq/util.urlerr for py3 compat 2016-04-06 23:22:12 +00:00
changegroup.py changegroup: don't fail on empty changegroup (API) 2017-06-30 23:58:59 -07:00
changelog.py revlog: make 'storedeltachains' a "public" attribute 2016-10-14 02:25:08 +02:00
chgserver.py pager: set some environment variables if they're not set 2017-04-13 08:27:19 -07:00
cmdutil.py cmdutil: simplify the dirty check in howtocontinue() 2017-07-09 00:53:16 -04:00
color.py configitems: register the 'color.mode' config 2017-06-30 03:32:09 +02:00
commands.py identify: simplify the dirty check 2017-07-09 00:19:03 -04:00
commandserver.py commandserver: update comment about setpgid 2016-07-18 15:59:08 +01:00
compat.h compat: define ssize_t as int on 32bit Windows, silences C4142 warning 2016-07-15 23:54:56 +09:00
config.py ui: move configlist parser to config.py 2017-03-17 09:19:56 -07:00
configitems.py configitems: add alias support in config 2017-07-07 08:33:10 +02:00
context.py subrepo: consider the parent repo dirty when a file is missing 2017-07-09 02:55:46 -04:00
copies.py merge: avoid superfluous filemerges when grafting through renames (issue5407) 2016-10-25 21:01:53 +02:00
crecord.py patch: rewrite reversehunks (issue5337) 2017-06-20 23:22:38 -07:00
dagop.py followlines: join merge parents line ranges in blockdescendants() (issue5595) 2017-07-05 13:54:53 +02:00
dagparser.py error: get Abort from 'error' instead of 'util' 2015-10-08 12:55:45 -07:00
dagutil.py dagutil: use absolute_import 2015-08-08 19:04:09 -07:00
debugcommands.py revset: make repo.anyrevs accept customized alias override (API) 2017-06-24 15:29:42 -07:00
destutil.py show: implement "stack" view 2017-07-01 22:38:42 -07:00
dirstate.py dirstate: expose a sparse matcher on dirstate (API) 2017-07-08 16:18:04 -07:00
dirstateguard.py dirstateguard: move to new module so I can break some layering violations 2016-11-21 21:29:32 -05:00
discovery.py checkheads: use a "lazyancestors" object for allfuturecommon 2017-06-05 13:44:15 +01:00
dispatch.py dispatch: remove unused _loaded 2017-06-24 02:39:21 +09:00
dummycert.pem ssl: on OS X, use a dummy cert to trick Python/OpenSSL to use system CA certs 2014-09-26 02:19:48 +02:00
encoding.py py3: add utility to forward __str__() to __bytes__() 2017-06-24 13:48:04 +09:00
error.py py3: implement __bytes__() on most of our exception classes 2017-06-01 22:43:24 +09:00
exchange.py pushrace: avoid crash on bare push when using concurrent push mode 2017-06-28 17:41:25 +02:00
exewrapper.c exewrapper: prefer HackableMercurial python if availbale 2017-03-13 12:44:13 -07:00
extensions.py dispatch: fix typo suggestion for disabled extension 2017-07-07 00:13:53 -07:00
fancyopts.py py3: slice over bytes to prevent getting it's ascii value 2017-06-25 08:36:51 +05:30
filelog.py filelog: fix parsemeta docstring 2017-05-02 22:39:14 -07:00
filemerge.py filemerge: convert a couple of wvfs calls in internal mergetools to contexts 2017-06-26 22:52:15 -07:00
fileset.py help: clarify quotes are needed for filesets.size expressions 2016-09-21 16:33:37 +00:00
formatter.py formatter: proxy fm.context() through converter 2017-06-26 09:33:01 +09:00
graphmod.py dagop: split module hosting DAG-related algorithms from revset 2016-10-16 18:03:24 +09:00
hbisect.py hbisect: avoid shadowing a variable in a list comprehension 2016-11-10 16:33:23 -05:00
help.py help: convert flag default to bytes portably 2017-05-28 15:49:29 -04:00
hg.py py3: check for bytes instead of str in isinstance 2017-06-22 03:20:11 +05:30
hook.py py3: convert keys of kwargs back to bytes using pycompat.byteskwargs() 2017-06-17 15:29:26 +05:30
httpconnection.py httpconnection: allow a global auth.cookiefile config entry 2017-03-09 22:35:10 -08:00
httppeer.py httppeer: unify hint message for PeerTransportError 2017-05-01 05:52:36 +09:00
i18n.py i18n: make the locale directory name the same string type as the datapath 2016-10-08 05:26:18 -04:00
keepalive.py keepalive: send HTTP request headers in a deterministic order 2017-04-13 18:04:38 -07:00
localrepo.py dirstate: expose a sparse matcher on dirstate (API) 2017-07-08 16:18:04 -07:00
lock.py lock: avoid unintentional lock acquisition at failure of readlock 2017-05-01 19:59:13 +09:00
lsprof.py lsprof: use print function 2016-01-02 11:40:53 -08:00
lsprofcalltree.py lsprofcalltree: use print function 2016-01-02 11:45:29 -08:00
mail.py mail: remove code to support < Python 2.7 2017-05-13 11:12:44 -07:00
manifest.py manifest: apply checkambig=True only for root 00manifest.i 2017-06-30 01:47:48 +09:00
match.py match: express anypats(), not prefix(), in terms of the others 2017-07-09 17:02:09 -07:00
mdiff.py py3: use pycompat.strkwargs() to convert kwargs keys to str 2017-06-27 00:23:32 +05:30
merge.py sparse: refactor update actions filtering and call from core 2017-07-06 16:29:31 -07:00
mergeutil.py checkunresolved: move to new package to help avoid import cycles 2016-11-21 21:31:45 -05:00
minirst.py minirst: look for column delimiters using slices instead of indicies 2017-05-28 15:47:43 -04:00
mpatch.c internals: move the bitmanipulation routines into its own file 2016-06-06 13:08:13 +02:00
mpatch.h mpatch: raise MemoryError instead of mpatchError if lalloc() failed 2016-08-07 10:06:56 +09:00
namespaces.py namespaces: record and expose whether namespace is built-in 2017-06-24 14:52:15 -07:00
node.py revlog: add support for partial matching of wdir node id 2016-08-19 18:26:04 +09:00
obsolete.py obsolete: pass cache argument of successors set explicitly 2017-06-30 15:02:19 +02:00
obsutil.py obsolete: closest divergent support 2017-06-30 15:27:19 +02:00
parser.py parser: preserve order of keyword arguments 2017-04-09 11:58:27 +09:00
patch.py patch: make parsepatch optionally trim context lines 2017-07-04 16:41:28 -07:00
pathutil.py util: rename checkcase() to fscasesensitive() (API) 2016-08-30 09:22:53 -07:00
peer.py py3: convert to next() function 2016-05-16 21:30:53 +00:00
phases.py bundle: add config option to include phases 2017-06-22 10:10:02 -07:00
policy.py policy: add cffi policy for PyPy 2016-06-07 15:35:58 +02:00
posix.py chmod: create a new file when flags are set on a hardlinked file 2017-04-26 16:05:22 +02:00
profiling.py check-config: syntax to allow inconsistent config values 2017-07-01 20:34:27 -07:00
progress.py configitems: register the 'progress.estimate' config 2017-06-30 03:44:04 +02:00
pushkey.py pushkey: use absolute_import 2015-08-08 19:57:27 -07:00
pvec.py base85: proxy through util module 2017-04-26 21:56:47 +09:00
pycompat.py pycompat: move the queue related definitions below queue import 2017-06-16 03:01:22 +05:30
rcutil.py osutil: proxy through util (and platform) modules (API) 2017-04-26 22:26:28 +09:00
registrar.py configitems: add an official API for extensions to register config item 2017-06-17 13:48:20 +02:00
repair.py strip: don't allow empty changegroup in bundle1 2017-06-30 23:58:31 -07:00
repoview.py repoview: remove special casing of "requirements" 2017-06-08 20:28:13 -07:00
revlog.py revlog: add an experimental option to mitigated delta issues (issue5480) 2017-06-23 13:49:34 +02:00
revset.py revset: define successors revset 2017-07-10 10:56:40 -07:00
revsetlang.py revset: make repo.anyrevs accept customized alias override (API) 2017-06-24 15:29:42 -07:00
scmposix.py pager: use less as a fallback on Unix 2017-04-28 20:51:14 +09:00
scmutil.py cleanupnode: do not use generator for node mapping 2017-07-09 15:11:19 +02:00
scmwindows.py osutil: proxy through util (and platform) modules (API) 2017-04-26 22:26:28 +09:00
server.py serve: add support for Mercurial subrepositories 2017-04-15 18:05:40 -04:00
setdiscovery.py setdiscovery: improves logged message 2017-06-10 18:47:09 +01:00
similar.py similar: remove caching from the module level 2017-01-13 11:42:36 -08:00
simplemerge.py py3: convert kwargs' keys' to str using pycompat.strkwargs() 2017-06-22 03:16:16 +05:30
smartset.py smartset: fix generatorset.last() to not return the first element (issue5609) 2017-06-27 23:50:22 +09:00
sparse.py sparse: shorten try..except block in updateconfig() 2017-07-10 21:55:43 -07:00
sshpeer.py py3: use pycompat.byteskwargs() to convert kwargs' keys to bytes 2017-06-27 00:20:55 +05:30
sshserver.py py3: replace os.environ with encoding.environ (part 2 of 5) 2016-12-18 01:46:39 +05:30
sslutil.py sslutil: check for missing certificate and key files (issue5598) 2017-07-10 21:09:46 -07:00
statichttprepo.py manifest: make manifestlog a storecache 2016-10-18 17:33:39 -07:00
statprof.py statprof: require input file 2017-01-18 22:45:07 -08:00
store.py store: py26 compat, don't use a dict comprehension 2016-10-09 12:58:22 +02:00
streamclone.py streamclone: stop using 'vfs.mustaudit = False' 2017-07-02 04:26:34 +02:00
subrepo.py subrepo: make the output references to subrepositories consistent 2017-07-09 16:13:30 -04:00
tagmerge.py tagmerge: use 'wvfs' instead of 'wfile' 2017-03-15 00:28:58 -07:00
tags.py tag: make sure the repository is locked when tagging 2017-07-02 01:41:37 +02:00
templatefilters.py json: pass formatting options recursively 2017-06-09 21:33:15 +09:00
templatekw.py template: add successors template 2017-07-03 11:22:00 +02:00
templater.py py3: convert kwargs' keys' to str using pycompat.strkwargs() 2017-06-22 03:16:16 +05:30
transaction.py transaction: apply checkambig=True only on limited files for similarity 2017-07-04 23:13:47 +09:00
treediscovery.py error: get Abort from 'error' instead of 'util' 2015-10-08 12:55:45 -07:00
txnutil.py txnutil: factor out the logic to read file in according to HG_PENDING 2017-02-21 01:20:59 +09:00
ui.py configitems: add alias support in config 2017-07-07 08:33:10 +02:00
unionrepo.py configitems: register the 'bundle.mainreporoot' config 2017-06-30 03:31:26 +02:00
upgrade.py upgrade: register all format variants in a list 2017-04-12 16:48:13 +02:00
url.py url: support auth.cookiesfile for adding cookies to HTTP requests 2017-03-09 22:40:52 -08:00
util.py py3: add b'' to make the regex pattern bytes 2017-06-25 03:11:55 +05:30
verify.py verify: fix length check 2017-03-29 14:49:14 -07:00
vfs.py vfs: add explanation about cost of checkambig=True in corner case 2017-07-04 23:13:47 +09:00
win32.py py3: use pycompat.getcwd instead of os.getcwd 2016-12-22 01:54:17 +05:30
windows.py windows: do not close stdout on flush() failure 2017-06-05 23:36:35 +09:00
wireproto.py configitems: register the 'server.preferuncompressed' config 2017-06-30 03:44:12 +02:00
worker.py worker: propagate exit code to main process 2017-04-15 13:27:44 +09:00