© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
198 replies
Denis

✅ DEV Certificate invalid password for ASP.NET in docker

I'm using docker compose orchestration for my solution containing ASP.NET projects.

I've created a DEV certificate using
dotnet dev-certs https -t -p changeit
dotnet dev-certs https -t -p changeit

The password for the certificate is supposed to be
changeit
changeit


In the
docker-compose-override.yml
docker-compose-override.yml
I've configured the path to the certificate and the password.
version: '3.4'

services:
  grpcserver:
    environment:
      - ASPNETCORE_ENVIRONMENT=Development
      - ASPNETCORE_URLS=https://+:443;http://+:80
      - ASPNETCORE_Kestrel__Certificates__Default__Path=/root/.aspnet/https/GrpcServer.pfx
      - ASPNETCORE_Kestrel__Certificates__Default__Password="changeit"
    ports:
      - "16080:80"
      - "16443:443"
    volumes:
      - ${APPDATA}/Microsoft/UserSecrets:/root/.microsoft/usersecrets:ro
      - ${APPDATA}/ASP.NET/Https:/root/.aspnet/https:ro
version: '3.4'

services:
  grpcserver:
    environment:
      - ASPNETCORE_ENVIRONMENT=Development
      - ASPNETCORE_URLS=https://+:443;http://+:80
      - ASPNETCORE_Kestrel__Certificates__Default__Path=/root/.aspnet/https/GrpcServer.pfx
      - ASPNETCORE_Kestrel__Certificates__Default__Password="changeit"
    ports:
      - "16080:80"
      - "16443:443"
    volumes:
      - ${APPDATA}/Microsoft/UserSecrets:/root/.microsoft/usersecrets:ro
      - ${APPDATA}/ASP.NET/Https:/root/.aspnet/https:ro


The path should be correct; however, the password is not working - I get an exception:

System.Security.Cryptography.CryptographicException: 'The certificate data cannot be read with the provided password, the password may be incorrect.'

When trying to check the certificates password using
openssl
openssl
, I also get an invalid password error.
Input:
openssl pkcs12 -in GrpcServer.pfx -noout
openssl pkcs12 -in GrpcServer.pfx -noout

Output: Mac verify error: invalid password?

Might be because I'm using the command incorrectly, but still... in both cases it is incorrect.

What am I doing wrong?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements
Next page

Similar Threads

asp.net ssl certificate?
C#CC# / help
3y ago
Certificate authentication only for certain paths - ASP.NET
C#CC# / help
3y ago
[ASP.NET Core] Apply a selfsigned certificate to asp.net core?
C#CC# / help
4y ago
Asp.Net: Errors when changing server certificate
C#CC# / help
2y ago