John Doe

John Doe

  • NA
  • 41
  • 2.9k

WCF Service - The service certificate is not provided

Sep 6 2020 4:47 PM
encountered a problem whereby the WCF Service Host does not detect the existence of the service certificate that is needed to host a WCF service.
 
System.InvalidOperationException: The service certificate is not provided. Specify a service certificate in ServiceCredentials.
 
Service Config
  1. <?xml version="1.0" encoding="utf-8"?>  
  2. <configuration>  
  3. <system.serviceModel>  
  4. <behaviors>  
  5. <serviceBehaviors>  
  6. <behavior name="announcementBehavior">  
  7. <!--The following behavior attribute is required to enable WCF serialization of large data sets -->  
  8. <dataContractSerializer maxItemsInObjectGraph="2147483647"/>  
  9. <serviceDiscovery>  
  10. <announcementEndpoints>  
  11. <endpoint kind="announcementEndpoint" address="net.tcp://localhost:8005/Announcement" binding="netTcpBinding" bindingConfiguration="RequestReplyNetTcpBinding"/>  
  12. </announcementEndpoints>  
  13. </serviceDiscovery>  
  14. <serviceThrottling maxConcurrentCalls="1500" maxConcurrentSessions="1500" maxConcurrentInstances="1500"/>  
  15. <serviceCredentials>  
  16. <serviceCertificate findValue="WCFServer" storeLocation="LocalMachine" storeName="TrustedPeople" x509FindType="FindBySubjectName" />  
  17. <clientCertificate>  
  18. <authentication certificateValidationMode="PeerTrust" trustedStoreLocation="LocalMachine" revocationMode="NoCheck"/>  
  19. </clientCertificate>  
  20. </serviceCredentials>  
  21. </behavior>  
  22. </serviceBehaviors>  
  23. </behaviors>  
  24. <service name="Test2ServLib.IService1" behaviorConfiguration="announcementBehavior">  
  25. <host>  
  26. <baseAddresses>  
  27. <add baseAddress="net.tcp://localhost:8006/Service1"/>  
  28. </baseAddresses>  
  29. </host>  
  30. <endpoint binding="netTcpBinding" bindingConfiguration="RequestReplyNetTcpBinding" contract="Test2ServLib.IService1" behaviorConfiguration="LargeEndpointBehavior" />  
  31. <bindings>  
  32. <netTcpBinding>  
  33. <binding name = "RequestReplyNetTcpBinding">  
  34. <security>  
  35. <message clientCredentialType="Certificate" />  
  36. </security>  
  37. </binding>  
  38. </netTcpBinding>  
  39. </bindings>  
  40. </system.serviceModel>  
  41. </configuration>

Answers (1)