Repository navigation
Closed
Closed
Copy link
Labels
area-System.Net.Securityneeds-author-actionAn issue or pull request that requires more info or actions from the author.no-recent-activityregression-from-last-release
Description
Compiling the following program with dotnet SDK 9 and running it in a dotnet runtime 9 based container on OpenShift works as expected:
namespace CertWatch
{
internal static class Program
{
public static void Main(string[] args)
{
Console.Out.WriteLine("Creating client");
HttpClient client = new HttpClient();
Console.Out.WriteLine("Client created");
try
{
var response = client.GetAsync("https://certspotter.com/").Result;
Console.Out.WriteLine($"Response received {response.StatusCode}");
}
catch (Exception ex)
{
Console.Out.WriteLine($"Exception: {ex.Message}");
Console.Out.WriteLine(ex.ToString());
}
finally
{
Console.Out.WriteLine("Leaving");
}
}
}
}Creating client
Client created
Exception: One or more errors occurred. (The proxy tunnel request to proxy 'http://proxy.dc4ca.siemens.de:8080/' failed with status code '403'.")
System.AggregateException: One or more errors occurred. (The proxy tunnel request to proxy 'http://proxy.dc4ca.siemens.de:8080/' failed with status code '403'.")
---> System.Net.Http.HttpRequestException: The proxy tunnel request to proxy 'http://proxy.dc4ca.siemens.de:8080/' failed with status code '403'."
at System.Net.Http.HttpConnectionPool.EstablishProxyTunnelAsync(Boolean async, CancellationToken cancellationToken)
...
Leaving
Building the very same program in dotnet 10 and running it in a dotnet 10 container leads to a segmentation fault:
Creating client
Client created
This is what I can see in OpenShift logs:
The container last terminated with exit code 139 because of Error.
This is the dockerfile used:
# See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
# This stage is used when running from VS in fast mode (Default for Debug configuration)
FROM mcr.microsoft.com/dotnet/runtime:10.0 AS base
LABEL build.commit=$GIT_HASH
LABEL org.opencontainers.image.source="CertWatch"
LABEL org.opencontainers.image.revision=$GIT_HASH
USER $APP_UID
WORKDIR /app
# This stage is used to build the service project
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
ARG BUILD_CONFIGURATION=Release
ARG GIT_HASH
ENV DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 \
DOTNET_CLI_TELEMETRY_OPTOUT=1
WORKDIR /src
COPY ["sources/CertWatch.csproj", "sources/"]
RUN dotnet restore "./sources/CertWatch.csproj"
COPY ["sources/", "sources/"]
WORKDIR "/src/sources"
RUN dotnet build "./CertWatch.csproj" -c $BUILD_CONFIGURATION -o /app/build /p:GitHash=${GIT_HASH}
# This stage is used to publish the service project to be copied to the final stage
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
ARG GIT_HASH
RUN dotnet publish "./CertWatch.csproj" -c $BUILD_CONFIGURATION -r linux-x64 --self-contained true -o /app/publish /p:PublishTrimmed=true /p:UseAppHost=true
# This stage is used in production or when running from VS in regular mode (Default when not using the Debug configuration)
FROM mcr.microsoft.com/dotnet/runtime-deps:10.0 AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["./CertWatch"]
I also tried to build with dotnet 9 sdk and run in dotnet 10 and this also fails.
As reference the pipeline configuration to build the container:
Reacted by Logan Bussell
Metadata
Metadata
Assignees
Labels
area-System.Net.Securityneeds-author-actionAn issue or pull request that requires more info or actions from the author.no-recent-activityregression-from-last-release
Type
Projects
- StatusShow more project fieldsDone
Activity
lbussell commentedon Nov 24, 2025
I can't reproduce this using Docker Desktop v4.51.0 on Windows (building for linux-x64) or Mac (linux-arm64) with v4.52.0. I created a new console app, copied in your Program.cs, and used your exact Dockerfile except I removed the git commit stuff.
@wtgodbe does this look like an aspnet issue?
RufusJWB commentedon Nov 24, 2025
On Docker I can't reproduce it neither. It must have something to do with OpenShift specifics.
omajid commentedon Nov 24, 2025
@tmds could not reproduce this on OpenShift either. He thinks this might be another instance of #121578 though.
tmds commentedon Nov 25, 2025
Note that I don't have a proxy server, so I did not reproduce what is probably an important part: the exception being thrown by 403 of the proxy server.
You can try if things are different with Red Hat's .NET build. You can build an image using:
RufusJWB commentedon Nov 29, 2025
I tried it with the Red Hat build and here it is working:
This is the dockerfile adapted to RedHat:
being build with Kaniko:
tmds commentedon Dec 1, 2025
The way you published the app ends up using the Microsoft .NET build with Red Hat base image for runtime-deps. That suggests the issue is triggered by the runtime-deps in the Microsoft image.
cc @jkotas
tmds commentedon Dec 1, 2025
@RufusJWB one additional thing you can try is to set
ENV HOME=/tmpwith Microsoft runtime-deps. I don't expect it to have an effect, but it's good to be sure. By adding this, we ensure that if the container runs with a random UID on OpenShift, the container user has a writable home.RufusJWB commentedon Dec 1, 2025
I adjusted my dockerfile to
but nothing changed. Still running into
The container last terminated with exit code 139 because of Error.RufusJWB commentedon Dec 9, 2025
@tmds @lbussell is there anything I can do to support the triage process?
25 remaining items
dotnet-policy-service commentedon Aug 16, 2026
Tagging subscribers to this area: @dotnet/ncl, @bartonjs, @vcsjones
See info in area-owners.md if you want to be subscribed.
wfurt commentedon Aug 27, 2026
I did another pass on this @RufusJWB and here is what I see. While I can reproduce the crash with .NET 10, I was not able to crash it with .NET 11. (#122569 + #125324) The last core is from .NET 9 - you would need to recompile the self-contained app to really pick up the fixes.
Now, this is not really the problem. The problem is that we fail to initialize OpenSSL so even if it does not crash with .NET 11, TLS & crypto will not work because problems with the OpenSSL configuration. You can run this inside the container where it is failing.
Or you can share your OpenSSL.conf -> The sock one seems just fine and I was unable to make it fail.
You can also add if not in your config.
let me know.
dotnet-policy-service commentedon Aug 27, 2026
This issue has been marked
needs-author-actionand may be missing some important information.dotnet-policy-service commentedon Oct 14, 2026
This issue has been automatically marked
no-recent-activitybecause it has not had any activity for 14 days. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will removeno-recent-activity.dotnet-policy-service commentedon Nov 16, 2026
This issue will now be closed since it had been marked
no-recent-activitybut received no further activity in the past 14 days. It is still possible to reopen or comment on the issue, but please note that the issue will be locked if it remains inactive for another 30 days.