Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mwclient uses SSL even when broken #358

Closed
nemobis opened this issue Feb 10, 2020 · 0 comments
Closed

mwclient uses SSL even when broken #358

nemobis opened this issue Feb 10, 2020 · 0 comments
Labels
Milestone

Comments

@nemobis
Copy link
Member

nemobis commented Feb 10, 2020

In my xmlrevisions branch:

$ python dumpgenerator.py --xml --xmlrevisions --api=http://www.insult.wiki/w/api.php
...
Traceback (most recent call last):
  File "dumpgenerator.py", line 2352, in <module>
    main()
  File "dumpgenerator.py", line 2344, in main
    createNewDump(config=config, other=other)
  File "dumpgenerator.py", line 1911, in createNewDump
    generateXMLDump(config=config, titles=titles, session=other['session'])
  File "dumpgenerator.py", line 755, in generateXMLDump
    for xml in getXMLRevisions(config=config, session=session):
  File "dumpgenerator.py", line 812, in getXMLRevisions
    site = mwclient.Site(apiurl.netloc, apiurl.path.replace("api.php", ""))
  File "/home/federico/.local/lib/python2.7/site-packages/mwclient/client.py", line 131, in __init__
    self.site_init()
  File "/home/federico/.local/lib/python2.7/site-packages/mwclient/client.py", line 153, in site_init
    retry_on_error=False)
  File "/home/federico/.local/lib/python2.7/site-packages/mwclient/client.py", line 235, in get
    return self.api(action, 'GET', *args, **kwargs)
  File "/home/federico/.local/lib/python2.7/site-packages/mwclient/client.py", line 286, in api
    info = self.raw_api(action, http_method, **kwargs)
  File "/home/federico/.local/lib/python2.7/site-packages/mwclient/client.py", line 434, in raw_api
    http_method=http_method)
  File "/home/federico/.local/lib/python2.7/site-packages/mwclient/client.py", line 395, in raw_call
    stream = self.connection.request(http_method, url, **args)
  File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 514, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='www.insult.wiki', port=443): Max retries exceeded with url: /w/api.php?format=json&continue=&meta=siteinfo%7Cuserinfo%7Cuserinfo&action=query&siprop=general%7Cnamespaces&uiprop=groups%7Crights%7Cblockinfo%7Chasmsg (Caused by SSLError(SSLError(1, u'[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:727)'),))

https://www.insult.wiki/w/api.php?action=query&meta=siteinfo&siprop=general fails for an SSL error, yet mwclient decides to use HTTPS as a protocol, we have no way to tell it to use HTTP.
https://mwclient.readthedocs.io/en/latest/reference/site.html

@nemobis nemobis added the bug label Feb 10, 2020
@nemobis nemobis added this to the 0.4 milestone Feb 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant