-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Description
Comment from @stephentoub in dotnet/corefx#28278 has pointed to the issue we have in SslStream where we mutate Options object.
The problem with mutating the object is that sharing the same Options across different SslStream instance can cause races and make different than expected callback be called.
Examples of mutating state:
https://github.com/krwq/corefx/blob/705e95f02d179cccc6a290e5cf9f05fbd9873ed3/src/System.Net.Security/src/System/Net/Security/SslStream.cs#L252
https://github.com/krwq/corefx/blob/705e95f02d179cccc6a290e5cf9f05fbd9873ed3/src/System.Net.Security/src/System/Net/Security/SslStream.cs#L323
https://github.com/krwq/corefx/blob/705e95f02d179cccc6a290e5cf9f05fbd9873ed3/src/System.Net.Security/src/System/Net/Security/SslStream.cs#L360