Thanks.
I ran requests from the the interpreter prompt and got the same error.
# python Python 2.7.14 (default, Oct 23 2017, 13:50:22) [GCC 4.2.1 Compatible FreeBSD Clang 3.4.1 (tags/RELEASE_34/dot1-final 208032)] on freebsd10 Type "help", "copyright", "credits" or "license" for more information.
import requests requests.get('https://wiki.vvfh.org')
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/site-packages/requests/api.py", line 72, in get return request('get', url, params=params, **kwargs) File "/usr/local/lib/python2.7/site-packages/requests/api.py", line 58, in request return session.request(method=method, url=url, **kwargs) File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 508, in request resp = self.send(prep, **send_kwargs) File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 618, in send r = adapter.send(request, **kwargs) File "/usr/local/lib/python2.7/site-packages/requests/adapters.py", line 506, in send raise SSLError(e, request=request) requests.exceptions.SSLError: HTTPSConnectionPool(host='wiki.vvfh.org', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)",),))
I ran pip install -U requests[security] as you suggested, and got the same result.
Then I installed python3.5 and pip3 and tried again. Same result.
pywikibot.exceptions.FatalServerError: HTTPSConnectionPool(host='wiki.vvfh.org', port=443): Max retries exceeded with url: /w/api.php (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)",),))
I even added this to user-config.py, but still got the same result.
def ignore_certificate_error(self, code): return True
You will also notice that the url is /w/api.php. This is despite defining scriptpath in the family file.
def scriptpath(self, code): return '/'
--On November 15, 2017 at 8:04:30 AM +0330 Dalba dalba.wiki@gmail.com wrote:
It seems requests is having trouble connecting to the website. See if connecting using requests directly from the interpreter prompt works or not:
import requests requests.get('https://wiki.vvfh.org/')
<Response [200]>
I would also try installing/upgrading requests[security]: $pip install -U requests[security]
On Wed, Nov 15, 2017 at 6:58 AM, Paul Schmehl pschmehl@tx.rr.com wrote:
I'm running MediaWiki 1.29.1 on FreeBSD 10.3-RELEASE running mysql 5.6.38, php 7.1.10 and python 2.7.14. The wiki is working fine.
I installed pywikibot using git clone. The ID is $Id: 03e22e8ea7bf53dc7c9d47b6d7ad98c3c7afabb4.
When I try to generate the family file, I get this error:
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='wiki.vvfh.org', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)",),))
It's strange, because the certs verify from the commandline and SSLLabs says the site rates an A and the entire chain is found. I'm not sure why python is failing the verification test.
I've been googling and trying to find a way to disable ssl verification, but I haven't found it. The software is installed on the server the wiki runs on, and I'm running it from the commandline, so not verifying SSL isn't a big issue. (Only I have access to the server.)
"The man who never looks into a newspaper is better informed than he who reads them, inasmuch as he who knows nothing is nearer the truth than he whose mind is filled with falsehoods and errors." - Thomas Jefferson
Paul Schmehl (pschmehl@tx.rr.com) Independent Researcher
pywikibot mailing list pywikibot@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikibot
"The man who never looks into a newspaper is better informed than he who reads them, inasmuch as he who knows nothing is nearer the truth than he whose mind is filled with falsehoods and errors." - Thomas Jefferson
Paul Schmehl (pschmehl@tx.rr.com) Independent Researcher