-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Unable to get acceptableIssuers from LocalCertificateSelectionCallback #52499
Comments
Tagging subscribers to this area: @dotnet/ncl, @vcsjones Issue DetailsI'm using a mTLS setup and wanted to get a list of
ConfigurationWorking configuration:
Errornous configuration:
Quick AnalysisDuring debugging I figured out that on Windows the method InitializeSecurityContext returns If this is a bug (and not a configuration issue) I would like to work on it in order to provide a fix.
|
What site are you connecting to @denisvasilik ? Does your peer provide list of CAs? Perhaps you can post packet capture of the handshake. |
For testing purposes I am trying to connect to Sample application output on Windows
Note: I provided a dummy client certificate and key in the repository so it's not possible to finish the handshake successfully, but it's enough to retrieve the acceptable issuers. Sample application output on Linux
Here are no I added a trace of the TLS handshake to the repro repository. Thank you for your support, if you need further information just let me know. |
I check and it seems like the server sends two names:
This will need some deeper investigation. The mechanism on Linux is probably different. We will probably need to call |
Triage: Rare scenario, likely won't happen in 6.0. We should take a look later though, add a test and fix it. |
When #45456 is done, we will be able to write tests for this. (without external dependency) |
Sounds great to me, I am looking forward working together on this issue. |
The fundamental problem is that the callback runs before the server sends the list. When I run the repro, remoteCertificate is also From archeology prospective @bartonjs started with dotnet/corefx#3736 back then in 1.0. To make it work, we will need to bring back |
Hi, I am also currently encountering this issue on Linux and OSX (works fine on windows). However, I am running .NET Core 3.1. (customer requires compliance with .NET Standard 2.1) is there a way to backport this fix onto 3.1 once it is fixed? Many thanks in advance! |
All .NET 3.1+ versions are compliant with .NET Standard 2.1. Why exactly does it force you to use .NET Core 3.1 and not something newer - e.g. .NET 6 which is also LTS? |
Hi, Thanks for your comment! You are of course right, I was under the illusion, that we would need to stick with 3.1, but now, that you mentioned it, I fail to recall my thought process. Sorry for the inconvenience, I'm looking forward to this fix! Edit: assuming I'll use .NET 6.0 - will this fix be present there (the current milestone is indicating 7.0.0) |
I'm using a mTLS setup and wanted to get a list of
acceptableIssuers
from theLocalCertificateSelectionCallback
at the client application. This works great on Windows, but fails on Ubuntu 20.04. Here is a sample application I used for reproduction and a snippet of the relevant location:Configuration
Working configuration:
Errornous configuration:
Quick Analysis
During debugging I figured out that on Windows the method InitializeSecurityContext returns
SecurityStatusPalErrorCode.CredentialsNeeded
(when appropriate). As a consequence, theLocalCertificateSelectionCallback
is called a second time with proper content of acceptable issuers. When looking at the InitializeSecurityContext or HandshakeInternal routine on Linux, it never returnsSecurityStatusPalErrorCode.CredentialsNeeded
. Instead it returnsSecurityStatusPalErrorCode.ContinueNeeded
which does not triggerLocalCertificateSelectionCallback
. Hence, there's no second invocation ofLocalCertificateSelectionCallback
providing the acceptable issuers.If this is a bug (and not a configuration issue) I would like to work on it in order to provide a fix.
The text was updated successfully, but these errors were encountered: