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

Initialize an internal CA store #397

Merged
merged 1 commit into from
Apr 5, 2016
Merged

Initialize an internal CA store #397

merged 1 commit into from
Apr 5, 2016

Conversation

brandur
Copy link
Contributor

@brandur brandur commented Mar 14, 2016

This attempts to give some semblance of thread safety to parallel
library requests by pre-assigning a certificate store, the
initialization of which seems to be a weak point for thread safety. Note
that while this does seem to empirically improve the situation, it
doesn't guarantee actual thread safety.

A longer term solution to the problem is probably to assign a per-thread
HTTP client for much stronger guarantees, but this is a little further
out. More discussion on that topic in #313.

Fixes #382.

@brandur
Copy link
Contributor Author

brandur commented Mar 14, 2016

/cc @stripe/api-libraries As described in #382, this does seem to improve the situation today to some degree, but is also probably the wrong thing over the long term. The only good news is that it won't preclude us from solving the problem the right way (once someone gets to it), with the only downside being that we may have to support Stripe.ca_store inside the immediate future.

Let me know if anyone has thoughts on this.

This attempts to give some semblance of thread safety to parallel
library requests by pre-assigning a certificate store, the
initialization of which seems to be a weak point for thread safety. Note
that while this does seem to empirically improve the situation, it
doesn't guarantee actual thread safety.

A longer term solution to the problem is probably to assign a per-thread
HTTP client for much stronger guarantees, but this is a little further
out. More discussion on that topic in #313.

Fixes #382.
@brandur
Copy link
Contributor Author

brandur commented Apr 5, 2016

I'm going to pull this in. It's far from a perfect solution, but should act to improve the status quo for users on JRuby.

@brandur brandur merged commit bebf77e into master Apr 5, 2016
@brandur brandur deleted the brandur-ca-store branch April 5, 2016 17:53
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.

2 participants