How can I send the password along with my certificate (X.509) in the WCF service?

I have a WCF service that uses an X.509 certificate as client credentials. Most of these credentials do not require a password to use it, just to set it up.

But now our client has a certificate that requires a password every time it is used (i.e. every time the service is running). This service calls another service n times a day, but fails if the certificate cannot be verified.

So far, we have asked our customers to order (and pay for) a new certificate every time we had this problem, but I and our customers are tired of going through it every time. I myself did not perform this service and did not have much experience with WCF and services.

I would like to know: is it possible to enter this password in our configuration file along with all other certificate information?

Here is part of the XML configuration for the service:

<configuration>
  <system.serviceModel>
    <client>
      <endpoint
        address="***"
        binding="basicHttpBinding"
        bindingConfiguration="***"
        behaviorConfiguration="HTTPSEndpoint"
        contract="***"
        name="***" />
    </client>
    <bindings>
      <basicHttpBinding>
        <binding
          name="***"
          sendTimeout="00:05:00"
          maxBufferSize="2147483647"
          maxReceivedMessageSize="2147483647" >
          <readerQuotas maxStringContentLength="2147483647" />
          <security mode="Transport">
            <transport clientCredentialType="Certificate" />
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>
    <behaviors>
      <endpointBehaviors>
        <behavior name ="HTTPSEndpoint">
          <clientCredentials>
            <clientCertificate
              findValue="***"
              storeLocation="LocalMachine"
              storeName="My"
              x509FindType="FindBySubjectName"/>
          </clientCredentials>
        </behavior>
      </endpointBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>
+5
source share
1 answer

The requirement to enter a password when receiving a certificate from the certificate store on the client machine is due to the fact that the certificate was imported with the option "Enable strong private key protection":

Importing a certificate to the certificate store.

This is often installed as part of standard server hardening processes. It is intended for situations where the certificate authenticates the user with the remote system while the user is in attendance.

, .

, . , , , - . .config, . ... - , " " .

, : " " , . , .

:

  • .
  • LocalMachine. , LocalMachine, , .
  • CurrentUser . , . , " ".
+3

All Articles