I just updated Octopus to 3.14.15926 and tested the Certificate management feature. It seems to add a duplicate (but hidden) entry in the certificate store if you publish twice using the import step.
What I did:
- Added a X509 certificate into Octopus certificate management.
- Created a test project and added the “Import Certificate” step template
- Specified to install into a custom user , store=my
- Deployed to a test server running a .net application that uses the certificate.
- Tested the application successfully
- Deployed a second time.
- When the application runs, it hits an error because it finds multiple certificates.
- Opened MMC and cannot see any duplicate certificates.
- Deleting the cert allows me to replicate the steps.
The .NET method that is hitting the error in our application is System.ServiceModel.Security.X509CertificateInitiatorClientCredential.SetCertificate() with the FindType set as X509FindType.FindByThumbprint
The error thrown is:
System.InvalidOperationException: Found multiple X.509 certificates using the following search criteria: StoreName ‘My’, StoreLocation ‘CurrentUser’, FindType ‘FindByThumbprint’, FindValue ‘7e5642d4c3ee04755d910cd3b0f3436bce0c2e99’. Provide a more specific find value.