简体   繁体   中英

Access company jira server with python-jira using certificates

My company uses its own multi-factor authentication to login to our jira server. Everything I have searched for only suggests how to connect to the server using username/password or an api-token. But I need to use our generated certificates to try and connect.

This is what I have so far:

import os
import requests
from atlassian import Jira


#certificates for request
CERT = '/path/to/cert'
KEY = '/path/to/key'

session = requests.Session()
session.cert = (CERT, KEY)
session.timeout = 5

jira = Jira(
   url="url",
   session=session)

issue = jira.issue('issue')

When I run this code I get this error:

SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain)

Any ideas on how to go about this?

try this code, if not work please can you contact with me provide me your email

import os
import requests
from atlassian import Jira


#certificates for request
CERT = '/path/to/cert'
KEY = '/path/to/key'

session = requests.Session()
session.cert = (CERT, KEY)
session.timeout = 5

jira = Jira(
   url="url",
   session=session)
# add this code 
jira.verify_ssl = False

issue = jira.issue('issue')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM