I created custom authentication by Wcf after that I created self-sign ssl in IIS 7.5
and use below code in web.config
<serviceCertificate findValue="CN = srv-erp"/>
and this one too
<serviceCertificate findValue="CN = srv-erp"
storeLocation="LocalMachine"
x509FindType="FindBySubjectName"
storeName="My"/>
and I used FindBySerialNumber too.
but they didn't work and I get this error
Cannot find the X.509 certificate using the following search criteria: StoreName 'My', StoreLocation 'LocalMachine', FindType 'FindBySubjectDistinguishedName', FindValue 'CN = srv-erp'.
Your help is appreciated
Best Answer
it seems that problem in the findValue property try to change it to serv-erp. You don't need to place key of property in findValue when you use x509FindType.
Also you may try to find you certificate by another type (see X509FindType reference) For instance, by thumbprint
Finally, ensure that your certificate is exist. Type Run in Search Windows and copy and paste certmgr.msc. Then on the menu click on Action -> Find certificates...