djangosslsentryraven

Disable SSL verification Sentry Raven in Django


I want to add a test sentry instance that has a self signed certificate.

The app has the default RAVEN_CONFIG

RAVEN_CONFIG = {
    'dsn': 'https://xxxx@sentry.tst2.server.com/2',
    # If you are using git, you can also automatically configure the
    # release based on the git info.
    'release': raven.fetch_git_sha(os.path.dirname(os.pardir)),
}

I tried to add 'verify_ssl':0 to the configuration dictionary to no avail.

This is the error I'm getting:

Traceback (most recent call last):
  File "/opt/apps/.virtualenvs/palantir/local/lib/python2.7/site-packages/raven/transport/threaded.py", line 162, in send_sync
    super(ThreadedHTTPTransport, self).send(data, headers)
  File "/opt/apps/.virtualenvs/palantir/local/lib/python2.7/site-packages/raven/transport/http.py", line 47, in send
    ca_certs=self.ca_certs,
  File "/opt/apps/.virtualenvs/palantir/local/lib/python2.7/site-packages/raven/utils/http.py", line 62, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 431, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 449, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "/opt/apps/.virtualenvs/palantir/local/lib/python2.7/site-packages/raven/utils/http.py", line 46, in https_open
    return self.do_open(ValidHTTPSConnection, req)
  File "/usr/lib/python2.7/urllib2.py", line 1197, in do_open
    raise URLError(err)
URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)>

Solution

  • Can you try adding verify_ssl=0 to your DSN as shown the docs:

    https://xxxx@sentry.tst2.server.com/2?verify_ssl=0