简体   繁体   中英

Access X509 Store in Service Fabric application

I've put my certificates in LocalMachine/My and want to access them thusly:

var store = new X509Store(StoreName.My, StoreLocation.LocalMachine);
store.Open(OpenFlags.ReadOnly);
var x509Certificate2Collection = store.Certificates.Find(X509FindType.FindByThumbprint, certThumbprint, false);
var myCert = x509Certificate2Collection.Count > 0 ? x509Certificate2Collection[0] : null;
store.Close();

This works fine on my local cluster, but not on my standalone one. The certificate I'm trying to access has NETWORK SERVICE in ACL for private keys.

I'd assume it's a permissions issue. Am I missing something obvious here?

How can I debug my standalone cluster?

The above code works fine. My issue was that my thumbprint was "" because I hadn't set my config overrides correctly!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM