Skip to content

Conversation

@xavdid-stripe
Copy link
Member

@xavdid-stripe xavdid-stripe commented Dec 19, 2024

Why?

#1431 fixed a deprecation warning, but introduced a bug because we weren't creating the SSL context correctly. We have a path to a file, so we should use cafile. I mistakenly thought that kwarg was the actual contents of a file. This now lines up with how httpx treated the string we were passing before.

Reported in #1437.

What?

  • use cafile kwarg instead of capath for ssl.create_default_context.

Testing

This script fails without the fix and passes with it:

import stripe

def main():
    stripe.default_http_client = stripe.HTTPXClient(allow_sync_methods=True)
    stripe.api_key = "sk_test_1234"
    print(stripe.Customer.list())
    
main()

See Also

@jar-stripe
Copy link
Contributor

replaced "Fixes" with "Reported in" in the description, so we don't automatically close the issue.

@jar-stripe jar-stripe merged commit 27c6833 into master Dec 19, 2024
15 checks passed
@jar-stripe jar-stripe deleted the fix-httpx-ssl branch December 19, 2024 22:05
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 this pull request may close these issues.

4 participants