-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker images: Unable to configure HTTPS endpoint #85
Comments
I have same problem and I don't how fix that |
this is a massive pain based on chatgpt the kestrel certificate and password need to be an env var I tried on my mac and also on windows |
this should be fixed |
let me pull again but I checked out the repo 2 days ago and I dont see any commits since |
@BardiaYaghmaie after some tinkering this works when running from visual studio as it does some additional magic but running docker-compose -f docker-compose.yml -f docker-compose.override.yml up -d is missing a few things so I would recommend updating the docker compose overrides and the documentation ..like the hardcoded windows paths and the fact that rider or just VS Code are not an option make it hard to use ..I had to switch from my mac to my windows machine to get it working |
Did you find any solution regarding the volumes set in docker-compose.override? I can't find 'usersecrets' and 'Https'. I can't find these two. |
@mbehnasr for db services I had to add
|
this one worked for me and the diff is that visual studio configure and runs with the correct certs while otherwise you need to generate your certs with a password amd mount the location and also tell dotnet where to find them and whats the password shopping.web: |
Hello there, I had the same problem with macOS M2 chip system, fixed the issue using given information under the ASP.NET documentation Docker Compose with HTTPS topic. Link for the documentation topic In summary it's saying for macOS: Generate certificate and configure local machine:
_dotnet dev-certs https --trust is only supported on macOS and Windows. You need to trust certificates on Linux in the way that is supported by your distribution. It is likely that you need to trust the certificate in your browser. In the preceding commands, replace Create a docker-compose.debug.yml file with the following content: version: '3.4' services: the password specified in the docker compose file must match the password used for the certificate. Start the container with ASP.NET Core configured for HTTPS: Also its my services:
catalogdb:
image: postgres
container_name: catalogdb
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=pass
- POSTGRES_DB=CatalogDb
restart: always
ports:
- "5432:5432"
volumes:
- postgres_catalog:/var/lib/postgresql/data
catalog.api:
image: catalog.api
build:
context: .
dockerfile: Services/Catalog/Catalog.API/Dockerfile
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_HTTP_PORTS=8080
- ASPNETCORE_HTTPS_PORTS=8081
- ConnectionStrings__Database=Server=catalogdb;Port=5432;Database=CatalogDb;User Id=postgres;Password=pass;Include Error Detail=true
- ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx
- ASPNETCORE_Kestrel__Certificates__Default__Password=useyourpassword
depends_on:
- catalogdb
ports:
- "6000:8080"
- "6060:8081"
volumes:
- /Users/<youruserpath>/.microsoft/usersecrets:/home/app/.microsoft/usersecrets:ro
- ~/.aspnet/https:/https:ro
|
For JetBrains Rider IDE users, try enabling the |
Following the README file, everything works fine, but the main services like catalog, ordering, basket, etc., didn't worked due to HTTPS config exception.
Exception:
System.InvalidOperationException: Unable to configure HTTPS endpoint. No server certificate was specified, and the default developer certificate could not be found or is out of date. To generate a developer certificate run 'dotnet dev-certs https'. To trust the certificate (Windows and macOS only) run 'dotnet dev-certs https --trust'.Docker log Terminal:
Any ideas?
The text was updated successfully, but these errors were encountered: