Ocelot + consul + my web api (.Net 5) via HTTPS in docker Ocelot + consul + my web api (.Net 5) via HTTPS in docker docker docker

Ocelot + consul + my web api (.Net 5) via HTTPS in docker


you have a ssl error last case. You may 2 options for this issue

  1. best.option you creating your own certificate and then getting it trusted by your local or remote machine.

  2. quick option you can add this line your ocelot.json

    "DangerousAcceptAnyServerCertificateValidator": true

you should add networks tag on your docker-compose file.like below:

version: '3'networks:  dockerapi:    driver: bridgeservices:  license-service-web-api-01:    image: license-service-web-api    container_name: license-service-01    build:       context: .      dockerfile: Services/LicenseServiceWebApi/Dockerfile    environment:                            - ASPNETCORE_ENVIRONMENT=Development      - ASPNETCORE_URLS=https://+:9001;http://+:9000          - ASPNETCORE_Kestrel__Certificates__Default__Password=${Kestrel_Certificate_Password}      - ASPNETCORE_Kestrel__Certificates__Default__Path=/root/.aspnet/https/aspnetdev.pfx    volumes:      - ${USERPROFILE}\.aspnet\https:/root/.aspnet/https/:ro    ports:      - 9000:9000      - 9001:9001    depends_on:      - consul    networks:      - dockerapi                          gateway:    image: gateway    container_name: gateway    build:       context: .      dockerfile: ApiGateway/gateway/Dockerfile                      environment:      - ASPNETCORE_ENVIRONMENT=Development      - ASPNETCORE_URLS=https://+:5001;http://+:5000      - ASPNETCORE_Kestrel__Certificates__Default__Password=${Kestrel_Certificate_Password}      - ASPNETCORE_Kestrel__Certificates__Default__Path=/root/.aspnet/https/aspnetdev.pfx    volumes:      - ${USERPROFILE}\.aspnet\https:/root/.aspnet/https/:ro     ports:      - 5001:5001      - 5000:5000    depends_on:      - consul    networks:      - dockerapi