-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
X509Chain behaviour inconsistent on Windows and Linux #29164
Comments
This is probably the same issue as in #28314 (closed), except a valid certificate chain is already built and attached here. It seems like the |
It's not that ExtraStore isn't used, it's that OpenSSL says that the 2nd entry isn't a valid issuer for the first. Windows is building the chain and reporting NotValidForUsage and InvalidBasicConstraints. OpenSSL says "this is clearly not an issuer I need to consider because it doesn't have the certSign key usage bit" (NotValidForUsage). It likely would have then noticed the basic constraints ca=false and ruled it out on those grounds, too. While we do try to do work to make even invalid chains build the same way, ultimately we let the system X.509 libraries do the work, and I don't think there's any way we can really coerce OpenSSL into having a different opinion here. |
Another inconsistency is about revocation lists, for example this certificate:
If If
This is due to the certificate apparently having cRL extension with value of octet string
and the code trying to read an ASN.1 sequence. Couldn't find any proof in RFC that it's a valid value, but should be more forgiving. |
Not throwing during extension processing does seem sensible, and is something that we have control over. |
@bartonjs, regarding the chain problem, it looks like it's actually corefx code rejecting the certificates from the
I suppose this could be used to actually build the chain with |
@lil-Toady Ah, then perhaps you should try with a 3.0 preview build, since that code has been entirely replaced with "here, OpenSSL, it's everything I know about everything, do your magic" (no prefilter). |
@lil-Toady (That said, I feel like I tried the commandline |
I am still facing the same problem on linux, however, mac/windows are working. $PSVersionTable Name Value PSVersion 6.2.2 |
@smartpcr As far as I know, PowerShell 6.2 is still based on .NET Core 2.1. Any changes would only really be visible once PowerShell moves to .NET Core 3.0. But since multiple different problems were discussed in this issue, if you can clarify which problem you're having there might be advice that I can offer. |
We are running into a problem where the same chain is successfully built on Windows, populating ChainElements; yet fails with
PartialChain
on Linux, only having the leaf certificate in ChainElements;Whole trust chain is loaded into
ChainPolicy.ExtraStore
prior to validating the leaf. Verification flags do not affect the resultingChainStatus
andChainElements
in any way.It's reproducable on 2.2 runtime with the following basic code:
On windows output is:
As expected, the whole chain is there.
Yet on Linux it fails to build:
I'm also attaching the example project with Dockerfile based
dotnet:2.2-aspnetcore-runtime
(and docker launch target).X509ChainExample.zip
The text was updated successfully, but these errors were encountered: