SSL3 Certificate Verify Failed when Connecting to JIRA API Using Python

pyNovice89 picture pyNovice89 · May 30, 2014 · Viewed 18.3k times · Source

I'm currently running into an error when attempting to connect to JIRA using Python2.7 and the JIRA REST API (http://jira-python.readthedocs.org/en/latest/).

When I execute the following:

from jira.client import JIRA

options = {
    'server': 'https://jira.companyname.com'
}
jira = JIRA(options)

I get the following error message in console:

requests.exceptions.SSLError: [Errno 1] _ssl.c:507: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

Is there something that I may have missed or am doing incorrectly?

Thanks!

Answer

tinyint picture tinyint · Jun 17, 2014

I encountered a similar SSL certificate verification error and looking through the "JIRA" methods definitions, its possible to turn off the verification.

    :param options: Specify the server and properties this client will use. Use a dict with any
     of the following properties:
      * server -- the server address and context path to use. Defaults to ``http://localhost:2990/jira``.
      * rest_path -- the root REST path to use. Defaults to ``api``, where the JIRA REST resources live.
      * rest_api_version -- the version of the REST resources under rest_path to use. Defaults to ``2``.
      * verify -- Verify SSL certs. Defaults to ``True``.
      * resilient -- If it should just retry recoverable errors. Defaults to `False`.

Try this :

from jira.client import JIRA

options = {'server': 'https://jira.companyname.com','verify':False}
jira = JIRA(options)