1

Having a behaviour for a endpoint, I specified a serviceCertificate to be used. Everything works fine, but every year we get a new certificate on our servers while the old ones are being left undeleted.

This results in 2 valid certificates (overlapping few days in validity period), both with the same name. When having 2 certificates with the same name, using the service throws an error:

The exception message is: Found multiple X.509 certificates using the following search criteria: StoreName 'My', StoreLocation 'LocalMachine', FindType 'FindBySubjectName', FindValue 'CertName'. Provide a more specific find value

<behaviors>
  <serviceBehaviors>
    <behavior name="serviceBehaviour">
      <serviceCredentials>
        <serviceCertificate findValue="CertName" storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName"  />
      </serviceCredentials>
    </behavior>
  </serviceBehaviors>
</behaviors>

I know how to solve this problem for now by deleting the old certificate, but I found no way to solve this for long term, i.e. taking always the first valid certificate.

Is there any way to specify to take one certificate, regardless of the number of available ones that match? I don't want to modify our config files everytime we get a certifcate renewed.

3
  • Hi @Chriz, I got exactly the same issue. Just wonder if you found a solution to this problem? Commented May 28, 2020 at 10:41
  • @DariusKvitnickas I didn't. My solution was to, when this error showed up, delete the older certificate by hand. Commented May 28, 2020 at 11:42
  • Ok, thanks @Chriz. It looks that it's not possible to achieve it in the config file. Commented May 28, 2020 at 17:19

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.