My WCF service has following security settings:-
at server side(web.config) :-
<behavior name="myBehaviour" >
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceMetadata httpGetEnabled="true" />
<serviceCertificate findValue="localhost" storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName" />
<binding name="Binding1" transactionFlow="true">
<message clientCredentialType="UserName" />
At client side(App.config) security settings are :-
<transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="true" />
I have create a root security certificate using :-
makecert -n "CN=TempCA" -r -sv TempCA.pvk TempCA.cer
And create a new certificate signed by a root authority certificate as :-
makecert -sk SignedByCA -iv TempCA.pvk -n "CN=localhost" -ic TempCA.cer SignedByCA.cer -sr LocalMachine -ss My
Now I installed root security certificate in Trusted Root Certification Authorities and signed certificate in Personal folder.
I have also provided Read rights to ASPNET process for the folder( and its parent folders) containing private key file and also to the private key file .
WCF service is hosted in IIS and client ( also .Net application) is running on same machine.
But when i run the service, I am getting this error:-
The certificate 'CN=localhost' must have a private key that is capable of key exchange. The process must have access rights for the private key.
Pls tell what I am missing