Based on T102602 and use test.orain.org for testing.
> import pywikibot
> site = pywikibot.Site()
> from pywikibot.login import OauthLoginManager
> consumer_token = ('XXXXXXXXXXXXXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXXXXXXXXXXXXX')
> login_manager = OauthLoginManager(consumer_token, site)
> login_manager.login()
Logging in to oraintest:en via OAuth consumer XXXXXXXXXXXXXXXXXXXXXXXXXX
Authenticate via web browser
Response query string: XXXXXXXXXXXXXXXXXXXXXXXXXX
ERROR: [('SSL routines', 'SSL23_GET_SERVER_HELLO', 'sslv3 alert handshake failure')]
The exception is actually raised by `complete` function in mwoauth (use mwoauth 0.2.4):
def complete(mw_uri, consumer_token, request_token, response_qs):
"""
Completes an OAuth handshake with MediaWiki by exchanging an
:Parameters:
mw_uri : `str`
The base URI of the MediaWiki installation. Note that the URI
should end in ``"index.php"``.
consumer_token : :class:`~mwoauth.ConsumerToken`
A key/secret pair representing you, the consumer.
request_token : :class:`~mwoauth.RequestToken`
A temporary token representing the user. Returned by
`initiate()`.
response_qs : `bytes`
The query string of the URL that MediaWiki forwards the user back
after authorization.
:Returns:
An `AccessToken` containing an authorized key/secret pair that
can be stored and used by you.
"""
......
# Construct a new auth with the verifier
auth = OAuth1(consumer_token.key,
client_secret=consumer_token.secret,
resource_owner_key=request_token.key,
resource_owner_secret=request_token.secret,
verifier=verifier)
# Send the verifier and ask for an authorized resource owner key/secret
r = requests.post(url=mw_uri,
params={'title': "Special:OAuth/token"},
auth=auth)
......
The exception is raised by the last `r = requests.post(...)`sentence.
Also, the actual exception is hided because of T105767.
The issue may be related: https://github.com/kennethreitz/requests/issues/2022