You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a callback function that returns a X509Certificate. What is the desired behaviour if no acceptable certificate can be found. It can't return Null but might reasonably expect an exception be thrown.
One thing I have realised on rereading the docs. You expect to return null if not found but when compiled with nullable the signature is not allowing a null return. This might be a coding issue not a documentation one
One thing I have realised on rereading the docs. You expect to return null if not found but when compiled with nullable the signature is not allowing a null return. This might be a coding issue not a documentation one
That is correct, the issue has been fixed by dotnet/runtime#110479 and will be released in .NET 10. On older versions, you can avoid the warning by using null!. Given the trivial workaround, we are not considering servicing the older releases.
The .NET 10 docs already contain the right nullable annotations.
Type of issue
Typo
Description
This is a callback function that returns a
X509Certificate
. What is the desired behaviour if no acceptable certificate can be found. It can't return Null but might reasonably expect an exception be thrown.Page URL
https://learn.microsoft.com/en-us/dotnet/api/system.net.security.localcertificateselectioncallback?view=net-9.0
Content source URL
https://github.com/dotnet/dotnet-api-docs/blob/main/xml/System.Net.Security/LocalCertificateSelectionCallback.xml
Document Version Independent Id
049f2b57-9db1-a5de-1414-41b62b14c960
Platform Id
21e0151e-7b33-42f4-1e93-d366a70f6e9d
Article author
@karelz
The text was updated successfully, but these errors were encountered: