R – WCF Cant find server certificate using FindBYSubjectName

certificatenetwcf

I have a certificate installed in my test environment. The subject of this is delimited by commas e.g. S80, My Company Name, Country

The code below worked when the subject name was just S80 but now there are more details in the subject it no longer works.

  <serviceCredentials>
        <serviceCertificate findValue="S80, My Company Name, Country" storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName"/>
                 </serviceCredentials>

I get an error

Cannot find the X.509 certificate using the following search criteria: StoreName 'My', StoreLocation 'LocalMachine', FindType 'FindBySubjectName', FindValue 'S80, My Company Name, Country'.

If I just use S80 as the subject I get an error

Keyset does not exist

Any idea?

Best Answer

Can you find the certificate by something else? By thumbprint, for instance? Does that work?

Marc