Skip to content

Commit

Permalink
Make verify requests to Jira tickets configurable (#65)
Browse files Browse the repository at this point in the history
By default it retains current behavior - sets verify=False. If caller
would like to turn verify on they can pass verify=True on Ticket().
  • Loading branch information
pbabinca authored and dmranck committed Aug 28, 2019
1 parent 4ec2d92 commit 032af38
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ticketutil/ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ class Ticket(object):
"""
A class representing a ticket.
"""
def __init__(self, project, ticket_id):
def __init__(self, project, ticket_id, verify=False):
self.project = project
self.ticket_id = ticket_id
self.ticket_url = None
self.verify = verify

# Create our default namedtuple for our request results.
Result = namedtuple('Result', ['status', 'error_message', 'url', 'ticket_content'])
Expand Down Expand Up @@ -104,10 +105,10 @@ def _create_requests_session(self):
if self.auth == 'kerberos':
self.principal = _get_kerberos_principal()
s.auth = HTTPKerberosAuth(mutual_authentication=DISABLED)
s.verify = False
s.verify = self.verify
if isinstance(self.auth, tuple):
s.auth = self.auth
s.verify = False
s.verify = self.verify

# Try to authenticate to auth_url.
try:
Expand Down

0 comments on commit 032af38

Please sign in to comment.