Bug 4648 - Mercurial doesn't capture SSL client cert password prompt
Summary: Mercurial doesn't capture SSL client cert password prompt
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: 3.3.2
Hardware: All All
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-06 03:27 UTC by eimacdude
Modified: 2015-06-12 00:00 UTC (History)
3 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description eimacdude 2015-05-06 03:27 UTC
Using client certificates for authentication seems to cause the underlying SSL library to create a password prompt. This breaks TortoiseHg (which sits waiting patiently forever when you try push/pull) at the very least.
Comment 1 Matt Mackall 2015-05-06 03:33 UTC
"If the password argument is not specified and a password is required, OpenSSL’s built-in password prompting mechanism will be used to interactively prompt the user for a password."

- https://docs.python.org/2/library/ssl.html

We don't pass a password callback to load_cert_chain, so the commandserver breaks.

Related: https://bitbucket.org/tortoisehg/thg/issue/4144/basic-autnentication-is-only-weakly-secure
Comment 2 Yuya Nishihara 2015-05-07 08:27 UTC
I'll take a look at this. BTW, on Python 2.7.9, I got password prompt twice,
one by httplib.HTTPSConnection, another by sslutil.ssl_wrap_socket.
Comment 3 HG Bot 2015-06-03 17:00 UTC
Fixed by https://selenic.com/repo/hg/rev/21b536f01eda
Yuya Nishihara <yuya@tcha.org>
ssl: prompt passphrase of client key file via ui.getpass() (issue4648)

This is necessary to communicate with third-party tools through command-server
channel. This requires SSLContext backported to Python 2.7.9+.

It doesn't look nice to pass ui by sslkwargs, but I think it is the only way
to do without touching various client codes including httpclient (aka http2).
ui is mandatory if certfile is specified, so it has no default value.

BTW, test-check-commit-hg.t complains that ssl_wrap_socket() has foo_bar
naming. Should I bulk-replace it to sslwrapsocket() ?

(please test the fix)
Comment 4 Bugzilla 2015-06-12 00:00 UTC
Bug was set to TESTING for 8 days, resolving