princenyeche / jiraone

A REST API Implementation to Jira Cloud APIs for creating reports and for performing other Jira queries.
https://jiraone.readthedocs.io
MIT License
25 stars 11 forks source link

Private CA certificates / OAuth login #99

Closed 69baud closed 1 year ago

69baud commented 2 years ago

I am just trying out JiraOne to see if I can use it, connecting to a Jira Datacenter air-gapped installation for a client, and they have their own CA with certificates signed by that CA, but which JiraOne considers as self-signed and refuses to go further. Thus I’m stuck at the first step. I’ve had a look at the documentation, but can see no mention of certificates.

I’ve also followed Atlassian’s instructions to create an Application Link (generating an RSA key pair and supplying the key to Jira to create the application link) to use OAuth 1.0a, but don’t see how to use it with JiraOne or if it is possible.

I’d be grateful if you could advise me at all? Many thanks :-)

princenyeche commented 2 years ago

Hey @69baud

OAuth 1.0a isn't supported, only OAuth 2.0 and it's for cloud platforms. If you want to connect to Jira DC and use a self-signed CA. You can use the argument verify=False on any of the HTTP requests or you can use the path to the self-signed CA and make the request persistent.

# previous login statement
LOGIN.session.verify = "/path/to/certfile"
# OR
LOGIN.session.verify = False

Using the false value, jiraone won't validate the SSL certificate during connection. Let me know if that helps.

69baud commented 2 years ago

Thanks. I was following an Atlassian document on OAuth for Data Center. I guess it is out of date.

I've tried both options and it still complains about the SSL Self-Signed Cert. I ran the debugger and can't see where in JiraOne it actually passes session.verify (or cert_file) anywhere to requests.post or requests.get etc

I've also tried setting environment variables such as SSL_CERT_FILE pointing to the Root CA and Intermediate CA bundle (file in pem format) but still no joy.

Any other ideas?

Thanks :-)

princenyeche commented 2 years ago

Here are the two options:

OR

princenyeche commented 2 years ago

Let me know how it goes.

69baud commented 2 years ago

Thanks you :-)

your_cert_path = "direct_absolute_path/to/cert" os.environ["REQUESTS_CA_BUNDLE"] = your_cert_path

Fixed it 👍