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

Certificate error connecting to Cloudant with requests 2.32.3 #658

Closed
ricellis opened this issue May 31, 2024 · 3 comments · Fixed by #660
Closed

Certificate error connecting to Cloudant with requests 2.32.3 #658

ricellis opened this issue May 31, 2024 · 3 comments · Fixed by #660

Comments

@ricellis
Copy link
Member

Describe the bug

With cloudant-python-sdk and requests 2.32.3 connections to Cloudant fail with a certifcate error e.g.

[2024-05-29T18:13:25.703Z] urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='~mytestaccount~.cloudant.com', port=443): Max retries exceeded with url: /gauge-4f703d00-99c9-4ec0-b039-2eed7d05048d?partitioned=true (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)')))
requests.exceptions.SSLError: HTTPSConnectionPool(host='~myuuuid-bluemix~.cloudantnosqldb.appdomain.cloud', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)')))

To Reproduce

from ibmcloudant.cloudant_v1 import CloudantV1

service = CloudantV1.new_instance()
print(service.get_server_information().get_result())

Expected behavior

No error.

Screenshots

Must gather (please complete the following information):

  • SDK Version [e.g. 1.2.1]: 0.8.1
  • Python Version [e.g. Python 3.8]: 3.11.9
  • Name of service that you're trying to use (if applicable): Cloudant
  • Name of operation that you're trying to invoke (if applicable): any

Additional context

It is possible to workaround the issue by continuing to use requests 2.32.2.
See also psf/requests#6730

@ricellis
Copy link
Member Author

ricellis commented Jun 4, 2024

Fixed in https://github.com/IBM/cloudant-python-sdk/releases/tag/v0.8.2 by narrowing the requests dependency version range.

@ricellis
Copy link
Member Author

Release 0.9.0 was supposed to get a fix for this problem via https://github.com/IBM/python-sdk-core/releases/tag/v3.20.2, but it might not be working, so if you see this problem with version 0.9.0 and requests==2.32.3 then to workaround either:

  • downgrade to requests==2.32.2
  • stay on version 0.8.2

@ricellis
Copy link
Member Author

Version 0.9.1 depends on https://github.com/IBM/python-sdk-core/releases/tag/v3.20.3 that works around this problem and allows requests==2.32.3 to work.

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.

1 participant