Windows Docker how one container can trust another container certificate

16 views Asked by At

I have my docker Desktop running there are two containers running on https I have created the self signed certificate .pfx file. Now when I am running the container the Container A trying to register with container B. But I am getting the below error.

I have created the the self signed certificate using powershell command New-SelfSignedCertificate

`COPY certificate/gtest.pfx /app/certificate 
RUN powershell Import-PfxCertificate -FilePath ".\certificate\gtest.pfx"  -CertStoreLocation "Cert:\LocalMachine\My" -password (ConvertTo-SecureString "qwerth" -AsPlainText -Force)
RUN powershell ls Cert:\LocalMachine\My`

Error while running the container

authservice.tpsprk-1 | [10:56:15.160 ERR] There was an error while registering the service. {SourceContext="TS.Orbit.ServiceDiscovery.Client.ServiceRegistration.SelfRegistry", ProcessId=1624, ProcessName="dotnet", ThreadId=63} authservice.tpsprk-1 | System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception. authservice.tpspak-1 | ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid because of errors in the certificate chain: UntrustedRoot

Container A should register with Container B

0

There are 0 answers