Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Can not connect with python JIRA

Hello, 

I am new to JIRA. I need to connect to JIRA and do some queries. The problem is the begging, I can't connect.

 

The code that I use is the next one:

 

from jira import JIRA 

jira
= JIRA(options={'server':'http://...'}, basic_auth=(jira_user, jira_password))

 and I get an error asking for a certificate (...certificate_verify_failed...)

So, I found in Stack Overflow that you can add a certificate. So, I went to the browser, save the certificate that it is used as a file and then add the certificate to the JIRA object:

from jira import JIRA 

jira
= JIRA(options={'server':'http://...', 'verify':'path_to_certificate'}, basic_auth=(jira_user, jira_password))

Unfortunately, didn't work.

I also tried to set 'verify' to false but also not working...

Any recommendations?

Thank you very much 

2 answers

1 accepted

2 votes
Answer accepted
Payne Community Leader Jul 15, 2019

What is the error you are now receiving? Is your Jira instance a server or cloud instance? I can connect to a server instance using the exact same method that you are employing.

I get an error 'SSL CERTIFICATE_VERIFY_FAILED'. I am using a Jira server. Nothing seams to work...

For example, if I go with Firefox to the page and log in with the credentials it worked. Then, for example I use the api roots in the browser: http://customdomain/api/2/issue/JRA-1513 and I get the JSON in the browser. Which means that I have the rights to use the api but I am not able whit the python script. It always give me the same certificate error. 

Finally I fixed it! :)

I had to installed 

pip install python-certifi-win32

 and then it works! It was just a certification problem. 

Thank you for your help

Like Krishna Teja Medam likes this
Payne Community Leader Jul 16, 2019

To be sure we're using the same approach to saving and referencing the certificate, here is how I saved my cert:

  • Browsed to my Jira instance with Chrome
  • Clicked the padlock in the address bar
  • Clicked Certificate
  • Clicked Certification Path
  • Clicked the topmost option in the Certification path
  • Clicked View Certificate
  • Clicked the Certification Path tab
  • Clicked the Details tab
  • Clicked the Copy to File... button
  • Clicked Next
  • Selected Base-64 encoded X.509
  • Provided a path
  • Clicked the Finish button

I then reference it in my Python script using forward slashes, even though I'm on Windows, so the backslash won't act as a delimited, e.g.

cert_file = 'c:/mypath/SCRS-CA.crt'

Payne Community Leader Jul 16, 2019

Ah, after typing my response I now see that you solved it by installing a module. Glad you got it working!

Installing "python-certifi-win32" worked like a charm.

0 votes
Thomas Deiler Community Leader Jul 15, 2019

Dear @Borja P ,

please reopen your question again at https://community.developer.atlassian.com/. There is the right audience to assist.

So long

Thomas

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you