-
Notifications
You must be signed in to change notification settings - Fork 698
Open
Description
When I create (in my case a Jira) connection to which I pass a custom requests.Session
object that has its verify
set to a path, the client overrides this path in the passed session object with True
coming from the default value of verify_ssl
.
I need to set up a path to trust a self-signed certificate presented by a proxy server. Though with this override, I get an SSL error.
Example:
custom_session = requests.Session()
custom_session.verify = "<somepath>"
jira = Jira(
url=jira_url,
username=atlassian_username,
password=atlassian_api_token,
cloud=True,
session=custom_session
)
jql = 'project = ABC ORDER BY created DESC'
issues = jira.jql(jql)
Error
requests.exceptions.SSLError: HTTPSConnectionPool(host='<redacted>.atlassian.net', port=443): Max retries exceeded with url: /rest/api/2/search/jql?fields=%2Aall&jql=project+%3D+ABC+ORDER+BY+created+DESC (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1028)')))
Workaround
One can set verify_ssl
to the desired path, with the effect of overriding session's verify
parameter with the desired value, but that's not nice and
also not inline with your documentation where it's claimed to be a bool.
jira = Jira(
url=jira_url,
username=atlassian_username,
password=atlassian_api_token,
cloud=True,
session=custom_session,
verify_ssl="<somepath>"
)
Suggestion
I'd be better not to overwrite session's verify parameter if it's a custom session object.
Metadata
Metadata
Assignees
Labels
No labels