Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing certificates from trusted CAs #339

Closed
hunsalz opened this issue Feb 10, 2017 · 2 comments · Fixed by #1202
Closed

Passing certificates from trusted CAs #339

hunsalz opened this issue Feb 10, 2017 · 2 comments · Fixed by #1202
Assignees

Comments

@hunsalz
Copy link

hunsalz commented Feb 10, 2017

If your Jira runs in an environment with your own trusted CA you will have to instantiate jira with passing 'verify' the path of a CA_BUNDLE file or directory with certificates of trusted CAs. See http://docs.python-requests.org/en/master/user/advanced/#ssl-cert-verification

options = {
   "server" : 'https://your-jira.your-domain.org',
   "verify" : 'your-ca.crt'
}
jira = JIRA(options, basic_auth=('user', 'password')

Otherwise you will receive:

requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)

Unfortunately it doesn't work with the config.py module as well. The reason is the boolean assumption in line 85

verify = config.getboolean(profile, 'verify')

Simple working solution is:

verify = config.get(profile, 'verify')
if verify.lower() == 'true':
   verify = True
elif verify.lower() == 'false':
   verify = False

Maybe the boolean decision is imaginable in a more pythonic way ...?

@ssbarnea ssbarnea self-assigned this Feb 10, 2017
@ssbarnea
Copy link
Member

ssbarnea commented Feb 10, 2017

Dealing with certificates is outside the scope of this library. We are using requests library so you can use it to change SSL certificate bundle via REQUESTS_CA_BUNDLE.

You are more than welcome to chaise all SSL related bugs directly on requests library issue tracker.

We may have some historical relics related to altering SSL behaviour directly in jira library but these are unsupported and I will remove them soon.

@hunsalz
Copy link
Author

hunsalz commented Feb 10, 2017

@ssbarnea : I suppose you misunderstood me. I don't suggest to add any new SSL functionality. It's about the misinterpretation of the 'verify' config param in config.py module. The verify parameter isn't strictly a boolean value. In fact it's allowed to pass a path to a directory with certificates or a path to a single certificate and this will be processed by OpenSSL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants