stylianosnicoletti / dotnet-certificate-tool

Command line tool to install and remove certificates from the current user's store.
https://www.nuget.org/packages/dotnet-certificate-tool
Apache License 2.0
109 stars 28 forks source link

CurrentUser store not showing added certificates inside a Docker container. #22

Closed sebastian-adamo closed 2 years ago

sebastian-adamo commented 3 years ago

I have added a .pfx certificate via the tool to a Docker container and it shows that it installs successfully.

image

However, when I try to list all certificates in said user store in a .NET Core application, the store indicates that there are 0 certificates contained within it.

Could this be an issue with a difference in Linux user on Docker build vs Docker run?

yohanb commented 3 years ago

Hi @sebastian-adamo, are you sure the same user is being used for the install and list operations? You can always check manually if the certificate is the in the ~/.dotnet/corefx/cryptography/x509stores/my/ folder.

sebastian-adamo commented 3 years ago

Hi @yohanb, thanks for the reply. We have determined that the user installing the certificate during container build time is different to the one trying to access it in a .NET application during runtime. As such, I think that this is an issue with Docker.

yohanb commented 3 years ago

@sebastian-adamo unless specified otherwise the user should be root.