csaftoiu / slack-email-digest

Scripts to summarize Slack chat history into an email digest.
The Unlicense
6 stars 1 forks source link

SSL error when running the script #11

Closed srid closed 8 years ago

srid commented 8 years ago

Not sure how this is happening:

 ./myenv/bin/python scripts/slack-email-digest.py -v --from=from@example.com --to=csaftoiu@gmail.com --token "snip" --delivery=stdout
Getting messages from 2016-08-05 19:51:08-04:00 to 2016-08-06 19:51:08-04:00
Retrieved 68 messages
Getting shortened URL for https://secure.gravatar.com/avatar/7858d1ce739fca5301435fb302794c5e.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2F3654%2Fimg%2Favatars%2Fava_0018-72.png...
Traceback (most recent call last):
  File "/Users/srid/code/slack-email-digest/myenv/lib/python3.5/site-packages/requests-2.10.0-py3.5.egg/requests/packages/urllib3/connectionpool.py", line 578, in urlopen
    chunked=chunked)
  File "/Users/srid/code/slack-email-digest/myenv/lib/python3.5/site-packages/requests-2.10.0-py3.5.egg/requests/packages/urllib3/connectionpool.py", line 351, in _make_request
    self._validate_conn(conn)
  File "/Users/srid/code/slack-email-digest/myenv/lib/python3.5/site-packages/requests-2.10.0-py3.5.egg/requests/packages/urllib3/connectionpool.py", line 814, in _validate_conn
    conn.connect()
  File "/Users/srid/code/slack-email-digest/myenv/lib/python3.5/site-packages/requests-2.10.0-py3.5.egg/requests/packages/urllib3/connection.py", line 289, in connect
    ssl_version=resolved_ssl_version)
  File "/Users/srid/code/slack-email-digest/myenv/lib/python3.5/site-packages/requests-2.10.0-py3.5.egg/requests/packages/urllib3/util/ssl_.py", line 308, in ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py", line 377, in wrap_socket
    _context=self)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py", line 752, in __init__
    self.do_handshake()
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py", line 988, in do_handshake
    self._sslobj.do_handshake()
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py", line 633, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:645)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/srid/code/slack-email-digest/myenv/lib/python3.5/site-packages/requests-2.10.0-py3.5.egg/requests/adapters.py", line 403, in send
    timeout=timeout
  File "/Users/srid/code/slack-email-digest/myenv/lib/python3.5/site-packages/requests-2.10.0-py3.5.egg/requests/packages/urllib3/connectionpool.py", line 604, in urlopen
    raise SSLError(e)
requests.packages.urllib3.exceptions.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:645)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "scripts/slack-email-digest.py", line 167, in <module>
    main()
  File "scripts/slack-email-digest.py", line 142, in main
    html_renderer = HTMLRenderer(scraper)
  File "/Users/srid/code/slack-email-digest/slack_email_digest/HTMLRenderer.py", line 119, in __init__
    self.load_avatars()
  File "/Users/srid/code/slack-email-digest/slack_email_digest/HTMLRenderer.py", line 123, in load_avatars
    self.avatars[name] = get_shortened_url(info['profile']['image_72'])
  File "/Users/srid/code/slack-email-digest/slack_email_digest/memoize.py", line 31, in wrapped
    res = f(arg)
  File "/Users/srid/code/slack-email-digest/slack_email_digest/HTMLRenderer.py", line 77, in get_shortened_url
    res = pyshorteners.Shortener('Isgd', timeout=5).short(url)
  File "/Users/srid/code/slack-email-digest/myenv/lib/python3.5/site-packages/pyshorteners-0.6.0-py3.5.egg/pyshorteners/shorteners/__init__.py", line 108, in short
  File "/Users/srid/code/slack-email-digest/myenv/lib/python3.5/site-packages/pyshorteners-0.6.0-py3.5.egg/pyshorteners/shorteners/isgd.py", line 18, in short
  File "/Users/srid/code/slack-email-digest/myenv/lib/python3.5/site-packages/pyshorteners-0.6.0-py3.5.egg/pyshorteners/shorteners/base.py", line 25, in _get
  File "/Users/srid/code/slack-email-digest/myenv/lib/python3.5/site-packages/requests-2.10.0-py3.5.egg/requests/api.py", line 71, in get
    return request('get', url, params=params, **kwargs)
  File "/Users/srid/code/slack-email-digest/myenv/lib/python3.5/site-packages/requests-2.10.0-py3.5.egg/requests/api.py", line 57, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Users/srid/code/slack-email-digest/myenv/lib/python3.5/site-packages/requests-2.10.0-py3.5.egg/requests/sessions.py", line 475, in request
    resp = self.send(prep, **send_kwargs)
  File "/Users/srid/code/slack-email-digest/myenv/lib/python3.5/site-packages/requests-2.10.0-py3.5.egg/requests/sessions.py", line 606, in send
    history = [resp for resp in gen] if allow_redirects else []
  File "/Users/srid/code/slack-email-digest/myenv/lib/python3.5/site-packages/requests-2.10.0-py3.5.egg/requests/sessions.py", line 606, in <listcomp>
    history = [resp for resp in gen] if allow_redirects else []
  File "/Users/srid/code/slack-email-digest/myenv/lib/python3.5/site-packages/requests-2.10.0-py3.5.egg/requests/sessions.py", line 179, in resolve_redirects
    **adapter_kwargs
  File "/Users/srid/code/slack-email-digest/myenv/lib/python3.5/site-packages/requests-2.10.0-py3.5.egg/requests/sessions.py", line 585, in send
    r = adapter.send(request, **kwargs)
  File "/Users/srid/code/slack-email-digest/myenv/lib/python3.5/site-packages/requests-2.10.0-py3.5.egg/requests/adapters.py", line 477, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:645)
srid commented 8 years ago

https://github.com/kennethreitz/requests/issues/2022