Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find the X.509 certificate using the following search criteria ----

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

like image 642
Hamed Khatami Avatar asked Aug 04 '15 11:08

Hamed Khatami


People also ask

What is the x 509 certificate?

X. 509 is a standard defining the format of public-key certificates. X. 509 certificates are used in many Internet protocols, including TLS/SSL, which is the basis for HTTPS, the secure protocol for browsing the web. They are also used in offline applications, like electronic signatures.


1 Answers

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.

<serviceCertificate findValue="srv-erp"
                            storeLocation="LocalMachine"
                            x509FindType="FindBySubjectName"
                            storeName="My"/>

Also you may try to find you certificate by another type (see X509FindType reference) For instance, by thumbprint

<serviceCertificate storeLocation="LocalMachine" storeName="My" x509FindType="FindByThumbprint" 
                            findValue="b5 ca b7 d0 b8 da fd 20 b7 bb 14 5d 66 2b 53 f3 0c 20 ca f2"/>

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...

like image 94
Andrew Miller Avatar answered Nov 15 '22 08:11

Andrew Miller