0

On a Redhat box (Red Hat Enterprise Linux Workstation release 6.8 (Santiago)) I am able to make a curl request to the JIRA instance like follows:

curl -k -D- -u "user":"password" -X GET -H "Content-Type: application/json" https://some_url/jira/rest/api/2/search?jql=assignee=fritz

This request returns a valid json with the actual data in it. So far so good.

To access and evaluate the information from the json I am trying to use jira-python in order to have a parser for the jira json's. The code is as follows:

jira = JIRA('https://some_url/jira', basic_auth=('user','password'))

which results in an error like follows:

WARNING:root:[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749) while doing GET https://some_url/jira/rest/api/2/serverInfo [{'params': None, 'headers': {'User-Agent': 'python-requests/2.12.4', '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'}}]

Why do I have a certificate error when trying to access the JIRA with python, but I do not when using curl? And how to fix this?

3

1 Answer 1

1

If you want to skip the certificate validation(not secure), set verify to False.

jira = JIRA('https://some_url/jira', verify=False, basic_auth=('user','password'))

As @frlan pointed out, it's better to validate the certificate. Just go through the JIRA arguments, and specify your client certificate for validation.

Explanation: https://github.com/pycontribs/jira/blob/5cade37e56612caee36db6310b6e0ef935726944/jira/client.py

 * verify -- Verify SSL certs. Defaults to ``True``.
Sign up to request clarification or add additional context in comments.

9 Comments

Don't deactivate certificate checks. If they fail, there is a reason.
@frlan And which reason could that be? And why is that important?
What @frlan said is right, there will be secure issue. To avoid Man-in-the-middle attack.
I guess a man-in-the-middle attack is irrelevant in my case. Why should someone in my company change JIRA ticket contents?
@Alex SSL is not a rocket science at least on basic level but is adding so much value. Just do it.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.