Click here to Skip to main content
15,867,453 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello all,
I have 2 .net core projects that work perfectly with each other when I run them normal, I have an API and a MVC UI. When I run them in docker containers, I go on my API with swagger, I figured out how to connect my postgres db and insert data successfully. When I go on my UI and I call the API I get this error:
An unhandled exception occurred while processing the request
AuthenticationException: The remote certificate is invalid according to the validation procedure: RemoteCertificateNameMismatch, RemotecertificateChainErrors.

I have a Dockerfile in my .net core project. I am not using docker compose.
Any ideas how to get my UI to call my API both running in separate containers? This is the last part of my project.
Thank you.

What I have tried:

I created a certificate and have it in my .net project. I am guessing I have to do something different to make this work with a container. (If this is what is wrong, I’m not sure yet.)
To put it in my normal project I did this.
C#
.UseKestrel(serverOptions =>
                    {
                        serverOptions.Listen(IPAddress.Loopback, 5010);
                        serverOptions.Listen(IPAddress.Loopback, 5011, listenOptions =>
                        {
                            listenOptions.UseHttps("localpfx.pfx", "password");
                        });
                    });
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900