sklarsa / django-sendgrid-v5

An implementation of Django's EmailBackend compatible with sendgrid-python v5+
MIT License
319 stars 54 forks source link

SSL: CERTIFICATE_VERIFY_FAILED #1

Closed pypetey closed 6 years ago

pypetey commented 6 years ago

I use Python 3.5 and newest available Django on Ubuntu 16.04 machine.

Any ideas?

ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)

During handling of the above exception, another exception occurred:

    return opener.open(request)
  File "/usr/lib/python3.5/urllib/request.py", line 466, in open
    response = self._open(req, data)
  File "/usr/lib/python3.5/urllib/request.py", line 484, in _open
    '_open', req)
  File "/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.5/urllib/request.py", line 1297, in https_open
    context=self._context, check_hostname=self._check_hostname)
  File "/usr/lib/python3.5/urllib/request.py", line 1256, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)>
sklarsa commented 6 years ago

This sounds like an environment configuration issue where urllib is looking for an SSL cert that doesn't exist. I'd take a look at this issue from the sendgrid-python library, which also references this stackoverflow issue which may help as well.

Also, check to make sure your machine also has a working SSL library installed before you install python. If not, you may need to download something like OpenSSL and then reinstall your python runtime.

sklarsa commented 6 years ago

@pypetey Any luck with this?

sklarsa commented 6 years ago

Closing for now since this appears to be an environment issue. Feel free to reopen if you are still experiencing difficulties connecting to sendgrid.