Python: 3.8
Jira module: jira-2.0.0-py2.py3-none-any.whl
This is my python script:
from jira.client import JIRA
import getpass
passwd = getpass.getpass('Password: ')
jira = JIRA(options = {'server': 'https://jira.example.com'}, basic_auth=('username', passwd))
And the output is:
WARNING:root:HTTPSConnectionPool(host='jira.example.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://jira.example.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'}}]
WARNING:root:Got ConnectionError [HTTPSConnectionPool(host='jira.example.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)')))] errno:None on GET https://jira.example.com/rest/api/2/serverInfo
{'response': None, 'request': <PreparedRequest [GET]>}\{'response': None, 'request': <PreparedRequest [GET]>}
WARNING:root:Got recoverable error from GET https://jira.example.com/rest/api/2/serverInfo, will retry [1/3] in 15.590765967470047s. Err: HTTPSConnectionPool(host='jira.example.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)')))
...
This issue has been solved with the following modification to code:
import jira.client
from jira import JIRA
import getpass
import urllib3
urllib3.disable_warnings()
passwd = getpass.getpass("Password: ")
jira = JIRA(options = {'server': 'https://jira.example.com', 'verify': False}, basic_auth=('username', passwd))
I am NOT sure if you still need answer but I found an answer just now. Just install "python-certifi-win32" and boom, certification error is cleared.
"Server" should be outside of "options" and NO need for
import getpass
passwd = getpass.getpass('Password: ')
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
I am also getting same issue while executing the script. My OS and python version is:
Python2.7
CentOS 7.9
I added the certificate in the script for the verification which is required and cant disable it (False)
i tested the script with Python3.6 but the issue is still same.
/usr/lib/python2.7/site-packages/requests/__init__.py:91: RequestsDependencyWarning: urllib3 (1.24.1) or chardet (2.2.1) doesn't match a supported version! (The error was fixed in Python3.6)
RequestsDependencyWarning)
WARNING:root:HTTPSConnectionPool(host='jira.example.com', port=443): Max retries exceeded with url: /rest/api/2/serverInfo (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:618)'),)) while doing GET https://jira.example.com/rest/api/2/serverInfo [{u'headers': {'Accept-Encoding': 'gzip, deflate', u'Accept': u'application/json,*.*;q=0.9', 'User-Agent': 'python-requests/2.21.0', 'Connection': 'keep-alive', u'X-Atlassian-Token': u'no-check', u'Cache-Control': u'no-cache', u'Content-Type': u'application/json'}, 'params': None}]
WARNING:root:Got ConnectionError [HTTPSConnectionPool(host='jira.example.com', port=443): Max retries exceeded with url: /rest/api/2/serverInfo (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:618)'),))] errno:None on GET https://jira.example.com/rest/api/2/serverInfo
{'request': <PreparedRequest [GET]>, 'response': None}\{'request': <PreparedRequest [GET]>, 'response': None}
WARNING:root:Got recoverable error from GET https://jira.example.com/rest/api/2/serverInfo, will retry [1/3] in 17.5623017522s. Err: HTTPSConnectionPool(host='jira.example.com', port=443): Max retries exceeded with url: /rest/api/2/serverInfo (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:618)'),))
WARNING:root:HTTPSConnectionPool(host='jira.example.com', port=443): Max retries exceeded with url: /rest/api/2/serverInfo (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:618)'),)) while doing GET https://jira.example.com/rest/api/2/serverInfo [{u'headers': {'Accept-Encoding': 'gzip, deflate', u'Accept': u'application/json,*.*;q=0.9', 'User-Agent': 'python-requests/2.21.0', 'Connection': 'keep-alive', u'X-Atlassian-Token': u'no-check', u'Cache-Control': u'no-cache', u'Content-Type': u'application/json'}, 'params': None}]
WARNING:root:Got ConnectionError [HTTPSConnectionPool(host='jira.example.com', port=443): Max retries exceeded with url: /rest/api/2/serverInfo (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:618)'),))] errno:None on GET https://jira.example.com/rest/api/2/serverInfo
{'request': <PreparedRequest [GET]>, 'response': None}\{'request': <PreparedRequest [GET]>, 'response': None}
WARNING:root:Got recoverable error from GET https://jira.example.com/rest/api/2/serverInfo, will retry [2/3] in 7.00724261109s. Err: HTTPSConnectionPool(host='jira.example.com', port=443): Max retries exceeded with url: /rest/api/2/serverInfo (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:618)'),))
WARNING:root:HTTPSConnectionPool(host='jira.example.com', port=443): Max retries exceeded with url: /rest/api/2/serverInfo (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:618)'),)) while doing GET https://jira.example.com/rest/api/2/serverInfo [{u'headers': {'Accept-Encoding': 'gzip, deflate', u'Accept': u'application/json,*.*;q=0.9', 'User-Agent': 'python-requests/2.21.0', 'Connection': 'keep-alive', u'X-Atlassian-Token': u'no-check', u'Cache-Control': u'no-cache', u'Content-Type': u'application/json'}, 'params': None}]
WARNING:root:Got ConnectionError [HTTPSConnectionPool(host='jira.example.com', port=443): Max retries exceeded with url: /rest/api/2/serverInfo (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:618)'),))] errno:None on GET https://jira.example.com/rest/api/2/serverInfo
{'request': <PreparedRequest [GET]>, 'response': None}\{'request': <PreparedRequest [GET]>, 'response': None}
WARNING:root:Got recoverable error from GET https://jira.example.com/rest/api/2/serverInfo, will retry [3/3] in 48.7617246555s. Err: HTTPSConnectionPool(host='jira.example.com', port=443): Max retries exceeded with url: /rest/api/2/serverInfo (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:618)'),))
WARNING:root:HTTPSConnectionPool(host='jira.example.com', port=443): Max retries exceeded with url: /rest/api/2/serverInfo (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:618)'),)) while doing GET https://jira.example.com/rest/api/2/serverInfo [{u'headers': {'Accept-Encoding': 'gzip, deflate', u'Accept': u'application/json,*.*;q=0.9', 'User-Agent': 'python-requests/2.21.0', 'Connection': 'keep-alive', u'X-Atlassian-Token': u'no-check', u'Cache-Control': u'no-cache', u'Content-Type': u'application/json'}, 'params': None}]
Traceback (most recent call last):
File "/scripts/jirapi.py", line 70, in <module>
createissue(importfile=args.file)
File "/scripts/jirapi.py", line 31, in createissue
jira = JIRA(jira_options, basic_auth=('api',pw))
File "/usr/lib/python2.7/site-packages/jira/client.py", line 472, in __init__
si = self.server_info()
File "/usr/lib/python2.7/site-packages/jira/client.py", line 2133, in server_info
j = self._get_json('serverInfo')
File "/usr/lib/python2.7/site-packages/jira/client.py", line 2549, in _get_json
r = self._session.get(url, params=params)
File "/usr/lib/python2.7/site-packages/jira/resilientsession.py", line 151, in get
return self.__verb('GET', url, **kwargs)
File "/usr/lib/python2.7/site-packages/jira/resilientsession.py", line 146, in __verb
raise exception
requests.exceptions.SSLError: HTTPSConnectionPool(host='jira.smar.ericsson.se', port=443): Max retries exceeded with url: /rest/api/2/serverInfo (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:618)'),))
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi @Krishna Teja Medam how can we do the same with API token authentication ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes,
I have used it for Confluence Reader
it required me to `pip install pip-system-certs`
from llama_index.readers.confluence import ConfluenceReader
reader = ConfluenceReader(base_url="<your instance url>", api_token ='<your token>')
documents = reader.load_data(
space_key=space_key, include_attachments=True, page_status="current"
)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm working on Jira Cloud. It was working fine before. But I encounter this issue this morning when I try the same python code before.
It throws error
requests.exceptions.SSLError: HTTPSConnectionPool
SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1018)')
Any suggestions?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Update:
I have tried the same python code at home with VPN enabled. It works fine.
So, I assume this would happen when you're in the org intranet behind a firewall? If this is the case, I guess only security team can solve the issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi!
Please, follow the next topic
Also, I made in your way https://github.com/atlassian-api/atlassian-python-api/blob/master/atlassian/rest_client.py#L45
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Join us to learn how your team can stay fully engaged in meetings without worrying about writing everything down. Dive into Loom's newest feature, Loom AI for meetings, which automatically takes notes and tracks action items.
Register today!Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.