0
votes

When running dotnet core in docker, i recently got this cryptic dotnet exception .

System.Security.Cryptography.CryptographicException: Unix LocalMachine X509Store is limited to the Root and CertificateAuthority stores.| ---\u003e System.PlatformNotSupportedException: Unix LocalMachine X509Store is limited to the Root and CertificateAuthority stores.|

Below exception, I got when I tried to open a certificate from my docker certificate store x509Store.Open(OpenFlags.ReadOnly)

The cause of the error was that the certificate was missing from my docker instance.

The exception thrown is not at all helpfull

1

1 Answers

0
votes

Presumably you're trying to open new X509Store(StoreName.My, StoreLocation.LocalMachine). The exception tells you that it's not supported on Unix.

new X509Store(StoreName.My, StoreLocation.CurrentUser) is the closest match. Or, since it's Unix, don't bother with the stores...