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

LocalCertificateSelectionCallback needs to document what happens if you can't find a suitable certificate to use #11112

Closed
MCFHTAGENTS opened this issue Mar 21, 2025 · 3 comments

Comments

@MCFHTAGENTS
Copy link

MCFHTAGENTS commented Mar 21, 2025

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

@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Mar 21, 2025
@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Mar 21, 2025
@gewarren gewarren added area-System.Net.Security and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Mar 25, 2025
Copy link
Contributor

Tagging subscribers to this area: @dotnet/ncl, @vcsjones

@MCFHTAGENTS
Copy link
Author

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

@rzikm
Copy link
Member

rzikm commented Mar 27, 2025

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.

@rzikm rzikm closed this as completed Mar 27, 2025
@dotnet-policy-service dotnet-policy-service bot removed the untriaged New issue has not been triaged by the area owner label Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants