-
Notifications
You must be signed in to change notification settings - Fork 511
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
[Foundation] Fix NSUrlSessionHandler thread issues. #1889
[Foundation] Fix NSUrlSessionHandler thread issues. #1889
Conversation
Do not deal with the configuration in the instance constructor. We do not need to do it for every instance AND it is racy.
To test the fix, please create an app like the following one: https://gist.github.com/chamons/793789e4bc01970c54d63bbe55777abf And used https://gist.github.com/chamons/67a3d39080bb3c9fa598f593fcfab919 to execute it until we have a crash. We should not have any runtime related crashed (you might get network ones related, for example, running the app with no connection to the internet) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's fine.
It means changing ServicePointManager.SecurityProtocol
to a new value will never have any impact after NSUrlSessionHandler
static ctor has been executed.
Please check this on .NET but I'm fairly sure you can change that setting and have further HttpClient instance honor this value.
I think correct fix is to use |
Build success |
…rotocol is set During the investigation for a System.Configuration race in bug #53461 [1] it was found that we did not pass the computed value for `TLSMinimumSupportedProtocol` based on `ServicePointManager.SecurityProtocols` to the `NSUrlSession`, in effect allowing what the OS does, by default, and not what the application requested. This replace an earlier attempt to fix the race in PR xamarin#1889 [1] https://bugzilla.xamarin.com/show_bug.cgi?id=53461 [2] xamarin#1889
PR 1890 fix another issue found while investigating bug #53461. However this is not related the the race, which happens in the BCL. |
…rotocol is set (#1890) During the investigation for a System.Configuration race in bug #53461 [1] it was found that we did not pass the computed value for `TLSMinimumSupportedProtocol` based on `ServicePointManager.SecurityProtocols` to the `NSUrlSession`, in effect allowing what the OS does, by default, and not what the application requested. This replace an earlier attempt to fix the race in PR #1889 [1] https://bugzilla.xamarin.com/show_bug.cgi?id=53461 [2] #1889
Do not deal with the configuration in the instance constructor. We do
not need to do it for every instance AND it is racy.
This fixes bug #53461.