Expected behavior Being able to make HTTPs calls from within the container
Actual behavior
System.InvalidOperationException: IDX10803: Unable to obtain configuration from: 'https://identity.test/.well-known/openid-configuration'. ---> System.IO.IOException: IDX10804: Unable to retrieve document from: 'https://identity.test/.we
ll-known/openid-configuration'. ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.CurlException: SSL connect error
Information I think the problem is that my container doesn't know at all about the certificates that need to be used for this http call. So what I tried to do is providing them to the container itself through the dockerfile that looks like this:
FROM microsoft/aspnetcore-build:2.0 AS build-env
WORKDIR /app
#Copy csproj and restore as distinct layers
COPY PublishOutput/. ./
FROM microsoft/aspnetcore:2.0
WORKDIR /app
COPY --from=build-env /app .
COPY Certificates/myCertificate.cer /usr/local/share/ca-certificates/myCertificate
RUN update-ca-certificates
ENTRYPOINT ["dotnet", "CaseApi.Web.dll"]
Inside the PublishOutput folder I just have all the dlls of my .net core api that I need to run inside the Docker container.
When I build the dockerfile it says:
Step 8/9 : RUN update-ca-certificates
---> Running in b025a42f2edc
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
which makes me think that the certificate I want to use isn't being really used. What am I doing wrong? Thanks in advance!
