osx - python: sslv3 alert handshake failure when scraping a site -
i using requests scrape project gutenberg when do:
import requests requests.get("https://www.gutenberg.org/wiki/science_fiction_(bookshelf)", verify = true)
i error:
sslerror traceback (most recent call last) <ipython-input-33-15981c36e1d3> in <module>() ----> 1 requests.get("https://www.gutenberg.org/wiki/science_fiction_(bookshelf)", verify=true) /library/python/2.7/site-packages/requests/api.pyc in get(url, params, **kwargs) 67 68 kwargs.setdefault('allow_redirects', true) ---> 69 return request('get', url, params=params, **kwargs) 70 71 /library/python/2.7/site-packages/requests/api.pyc in request(method, url, **kwargs) 48 49 session = sessions.session() ---> 50 response = session.request(method=method, url=url, **kwargs) 51 # explicitly closing session, avoid leaving sockets open 52 # can trigger resourcewarning in cases, , memory leak /library/python/2.7/site-packages/requests/sessions.pyc in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json) 463 } 464 send_kwargs.update(settings) --> 465 resp = self.send(prep, **send_kwargs) 466 467 return resp /library/python/2.7/site-packages/requests/sessions.pyc in send(self, request, **kwargs) 571 572 # send request --> 573 r = adapter.send(request, **kwargs) 574 575 # total elapsed time of request (approximately) /library/python/2.7/site-packages/requests/adapters.pyc in send(self, request, stream, timeout, verify, cert, proxies) 429 except (_sslerror, _httperror) e: 430 if isinstance(e, _sslerror): --> 431 raise sslerror(e, request=request) 432 elif isinstance(e, readtimeouterror): 433 raise readtimeout(e, request=request) sslerror: [ssl: sslv3_alert_handshake_failure] sslv3 alert handshake failure (_ssl.c:590)
this working few days ago , able scrape page. didn't change in code. did install heroku , postgres , don't know if causing errors.. can still requests google.com , other pages. using python version 2.7.10 , mac osx 10.10.5.
how past error scrape gutenberg page? don't understand error, appreciated.
it looks installed new ssl certificate (sept. 21, 2015) , when doing must have beefed security settings because site accepts tls 1.2 connections (no sslv3 library trying use, , no tls 1.0 or tls 1.1).
see results of ssl scan here.
the reason stopped working has nothing code, fact changed allowed security protocols , system (openssl version) doesn't appear support tls 1.2.
try upgrading openssl libraries on computer , should able connect site again (sorry don't know specifics of updating openssl libraries on mac python).
Comments
Post a Comment