SSL certificate verification error while authenticating into JIRA server using REST API

Anush Shankar
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 2, 2020

Hi Community,

While trying to authenticate into JIRA server using python library for interacting with JIRA via REST APIs, I get the following error:

WARNING:root:Got recoverable error from GET https://corporate.domain.com/rest/api/2/serverInfo, will retry [1/3] in 8.16608003441684s. Err: HTTPSConnectionPool(host='jerry.wincor-nixdorf.com', port=443): Max retries exceeded with url: /rest/api/2/serverInfo (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')))
WARNING:root:HTTPSConnectionPool(host='corporate.domain.com', port=443): Max retries exceeded with url: /rest/api/2/serverInfo (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)'))) while doing GET https://corporate.domain.com/rest/api/2/serverInfo [{'params': None, 'headers': {'User-Agent': 'python-requests/2.24.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json,*.*;q=0.9', 'Connection': 'keep-alive', 'Cache-Control': 'no-cache', 'Content-Type': 'application/json', 'X-Atlassian-Token': 'no-check'}}]

OS: Windows 10; 
python: 3.8.0
JIRA (Jira-python library package): 3.0.a2

 

Please also suggest whether the rest api endpoint used is correct!

PS: I sit behind a corporate network

2 answers

0 votes
Mike Cave
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 24, 2023

For future reference here's a rough code outline for how I solved this... - reference to the link provided by @Gonchik Tsymzhitov above shows all the parameter options and it will work for any product

 

from atlassian import Jira
from requests import Session
jira_verify = 'path to certificate'
url='http://product_url'
username='username'
password='secretthing'
session = Session()
session.verify = jira_verify
myjira = Jira(
            url=url,
            username=username
            password=password,
            session=session)
0 votes
Gonchik Tsymzhitov
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 27, 2021
Biswanath Chandramouli
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 28, 2023

How to resolve this error WITHOUT disabling ssl verification?

Suggest an answer

Log in or Sign up to answer