J'essaie d'héberger un service WCF avec wsHttpBinding. J'ai créé un certificat en utilisant makecert et j'ai mis quelques lignes dans web.config.aide à la configuration du service WCF wsHttpBinding sur .net
C'est l'erreur que je reçois:
System.ArgumentException: The certificate 'CN=WCfServer' must have a private key that is capable of key exchange. The process must have access rights for the private key.
Sur googler jusqu'à il semble être une question avec des droits d'accès sur le fichier de certificat. J'ai utilisé cacls pour donner la permission de lire au SERVICE RÉSEAU et aussi mon nom d'utilisateur mais cela n'a rien changé.
Je suis également allé aux paramètres de sécurité dans les propriétés du fichier de certificat et a donné un contrôle total au SERVICE RÉSEAU et mon nom d'utilisateur. Encore une fois en vain.
Pouvez-vous me dire quel est le problème et que dois-je faire exactement? Je suis vraiment floconneux avec ces choses de certificat.
Voici mon web.config:
<system.serviceModel>
<services>
<service name="Abc.Service" behaviorConfiguration="Abc.ServiceBehavior">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="Abc.BindConfig" contract="Abc.IService">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="Abc.ServiceBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
<serviceCredentials>
<clientCertificate>
<authentication certificateValidationMode="PeerTrust"/>
</clientCertificate>
<serviceCertificate findValue="WCfServer" storeLocation="CurrentUser" storeName="My" x509FindType="FindBySubjectName" />
</serviceCredentials>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<wsHttpBinding>
<binding name="Abc.BindConfig">
<security mode="Message">
<message clientCredentialType="Certificate" />
</security>
</binding>
</wsHttpBinding>
</bindings>
</system.serviceModel>