Closed Altair7610 closed 3 years ago
Tagging subscribers to this area: @dotnet/ncl See info in area-owners.md if you want to be subscribed.
Author: | Altair7610 |
---|---|
Assignees: | - |
Labels: | `area-System.Net.Security`, `untriaged` |
Milestone: | - |
Couple of high-level ideas:
SocketsHttpHandler
to see if our curl integration will work? ... Note: It will not help in .NET 5, but at least it may help us narrow down the root cause a bit more.@karelz I've tried .NET 5, but there's a problem with root CA certificate chain, and we have instant crash at start. With disabling SocketsHttpHandler on .NET Core 3.1 I got more luck, it isn't crashed with SSL after invoke, but throwed status code 401 "Unauthenticated"
The "Unauthenticated" (on 3.1 with disabled SocketsHttpHandler) feels like what you're getting in the original post "The remote certificate is invalid according to the validation procedure." ... which is weird as it uses curl under the hood. So apparently there is some difference in available certificates between command line curl and .NET with or without curl. Maybe that is the root of the problem? @wfurt will likely know more ...
Is 5.0 failing perhaps as #46654?
@karelz yeah, everything is exactly the same as in the #46654. Most likely I’ll have to wait until a new 5.0 build which fix that is released. Maybe @wfurt will advice something :) So far I had to deploy the authentication service to iis
It was confirmed that installing root CA fixes the problem. You can try it in mean time @Altair7610 It is curious that nothing posted on this issue relates to the #46654 e.g. that one is server problem but all posted traces show client side.
@wfurt I installed the root CA certficate inside the container and checked it in the certificates list by invoking awk
command, but it doesn't change the situation. This call is cross-server and when I removed second service from docker and deployed it to iis everything worked.
You claimed that this is same as #46654 but there is no evidence for that from what you posted. And you provided no information about the certificate and the chain. All the details could matter.
Why don't you add something like this to your validation callback and check why the certificate is being rejected.
handler.ServerCertificateCustomValidationCallback = (request, cert, chain, errors) =>
{
Console.WriteLine($"SslPolicyErrors: {errors}");
if (chain == null)
{
Console.WriteLine("No chain...");
}
else
{
foreach (X509ChainElement element in chain.ChainElements)
{
Console.WriteLine();
Console.WriteLine(element.Certificate.Subject);
Console.WriteLine(element.ChainElementStatus.Length);
foreach (X509ChainStatus status in element.ChainElementStatus)
{
Console.WriteLine($"Status: {status.Status}: {status.StatusInformation}");
}
}
}
}
Closing as there is not enough information to make it actionable. Feel free to reopen once more info is collected/available.
Environment:- Docker: Windows using Linux containers OS: Window 10 Microsoft.AspNetCore.App:3.1 Docker Image: mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim
Im just stuck at certificates problem inside docker containers. I have two ASP.NET Core apps: one is auth and based on IS4, another is just an secured gRPC api. To call api i need to get token from IS4 and pass to gRPC channel. All of them are secured with valid SSL certificate. Also I have console app to test it. Getting token from IS4 container is no problem, but when i`m trying to call api method it breaks at
when attempts to connect to
https://myaddress/.well-known/openid-configuration
. But when I run cli console inside api container and runcurl https://myaddress/.well-known/openid-configuration
it works and I get json answer.My
ConfigureServices
method in gRPC API:curl
output from container:Doesn`t seem that its docker problem (curl is working), any ideas?