I’m running an ASP.net Core API Project In the Docker Container part of this project, I have 3rd third-party service DocuSign that I make calls to once someone requests a new agreement to be created. I’m using an SDK that DocuSign provides. The issue I’m having is that when it goes to make an HTTPS call within the container it fails and gets an exception
“The SSL connection could not be established; see inner exception.”, if I look at the inner exception it is due to an Untrusted.
I running Docker Container through HTTPS. I have confirmed that Docker is passing the cert to the container, and I can hit my API via https with no issue, but seems that internally it cannot call https sites for some reason.
I am familiar new to Docker and I have looked and looked around and I cannot find anything that points me in the right direction.
Docker File:
#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.
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER app
WORKDIR /app
EXPOSE 8080
EXPOSE 8081
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["src/ThirdPartyFreight.Api/ThirdPartyFreight.Api.csproj", "src/ThirdPartyFreight.Api/"]
RUN dotnet restore "./src/ThirdPartyFreight.Api/ThirdPartyFreight.Api.csproj"
COPY . .
WORKDIR "/src/src/ThirdPartyFreight.Api"
RUN dotnet build "./ThirdPartyFreight.Api.csproj" -c $BUILD_CONFIGURATION -o /app/build
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./ThirdPartyFreight.Api.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "ThirdPartyFreight.Api.dll"]
Docker Compose:
version: '3.4'
services:
thirdpartyfreight.api:
image: ${DOCKER_REGISTRY-}thirdpartyfreightapi
container_name: ThirdPartyFreight.Api
build:
context: .
dockerfile: src/ThirdPartyFreight.Api/Dockerfile
ports:
- 28080:8080
- 28081:8081
csdtpfblazorwebapp-db:
image: mcr.microsoft.com/mssql/server:2022-latest
container_name: CSDTPFBlazorWebApp.Db
environment:
SA_PASSWORD: "xxxxxxxxxx"
ACCEPT_EULA: "Y"
ports:
- 1433:1433
volumes:
- ./.containers/database:/var/opt/mssql/data
csdtpfblazorwebapp-idp:
image: quay.io/keycloak/keycloak:latest
container_name: CSDTPFBlazorWebApp.Identity
environment:
- KEYCLOAK_ADMIN=admin
- KEYCLOAK_ADMIN_PASSWORD=xxxxx
command:
- start-dev
ports:
- 18080:8080
csdtpfblazorwebapp-seq:
image: datalust/seq:latest
container_name: CSDTPFBlazorWebApp.Seq
environment:
- ACCEPT_EULA=Y
ports:
- 5341:5341
- 8081:80
csdtpfblazorwebapp-redis:
image: redis:latest
container_name: CSDTPFBlazorWebApp.Redis
ports:
- 6379:6379
Docker Compose OverRide
version: '3.4'
services:
thirdpartyfreight.api:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_HTTP_PORTS=8080
- ASPNETCORE_HTTPS_PORTS=8081
ports:
- "8080"
- "8081"
volumes:
- ${APPDATA}/Microsoft/UserSecrets:/home/app/.microsoft/usersecrets:ro
- ${APPDATA}/ASP.NET/Https:/home/app/.aspnet/https:ro