I've followed the guide for loading a development certificate to be used by my docker container, but how do you have that certificated trusted in the container itself?
For example:
Browser (Host) --> ASP.NET Core Web API (Docker Container) --> ASP.NET Core MVC App (Host)
The host has the certificate trusted and can access the Web API no issue, but the Web API can't call the MVC App because the development certificate is not trusted in the container. I suspect this question will be valid if the MVC App is hosted in a separate container as well where I'd want everything to share the same development certificate.
My docker-compose.yml
is as follows:
version: "3.9"
services:
web:
build:
context: ../../
ports:
- "${WEB_HTTP_PORT}:80"
- "${WEB_HTTPS_PORT}:443"
volumes:
- ~/.aspnet/https:/https:ro
environment:
- ASPNETCORE_Kestrel__Certificates__Default__Path=/https/${WEB_CERTIFICATE_FILE}
- ASPNETCORE_Kestrel__Certificates__Default__Password=${WEB_CERTIFICATE_PASSWORD}
depends_on:
- db
- solr
<-- more services -->
I thought I could possibly run dotnet dev-certs https --trust
within the container, but it doesn't pick up the cert loaded in via the volume. I'm guessing I should be able to access the cert file from the volume, but I'm not sure how (lack of Linux knowledge most likely).